From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751283AbdFAHXw (ORCPT ); Thu, 1 Jun 2017 03:23:52 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:36230 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751013AbdFAHXv (ORCPT ); Thu, 1 Jun 2017 03:23:51 -0400 Date: Thu, 1 Jun 2017 16:23:54 +0900 From: Sergey Senozhatsky To: Sergey Senozhatsky Cc: Jan Kara , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Andrew Morton , Peter Zijlstra , "Rafael J . Wysocki" , Eric Biederman , Greg Kroah-Hartman , Jiri Slaby , Pavel Machek , Andreas Mohr , Tetsuo Handa , linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCHv3 2/5] printk: introduce printing kernel thread Message-ID: <20170601072354.GC3506@jagdpanzerIV.localdomain> References: <20170509082859.854-1-sergey.senozhatsky@gmail.com> <20170509082859.854-3-sergey.senozhatsky@gmail.com> <20170510055935.GA1966@jagdpanzerIV.localdomain> <20170529092906.GD21894@pathway.suse.cz> <20170529121235.GG3608@quack2.suse.cz> <20170531073058.GD7672@jagdpanzerIV.localdomain> <20170601072102.GB3506@jagdpanzerIV.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170601072102.GB3506@jagdpanzerIV.localdomain> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (06/01/17 16:21), Sergey Senozhatsky wrote: > On (05/31/17 16:30), Sergey Senozhatsky wrote: > > On (05/29/17 14:12), Jan Kara wrote: > > [..] > > > Actually I had something very similar in old versions of my patch set. And > > > it didn't work very well. The problem was that e.g. sometimes scheduler > > > decided that printk kthread should run on the same CPU as the process > > > currently doing printing and in such case printk kthread never took over > > > printing and the machine locked up due to heavy printing. > > > > hm, interesting. > > that's a tricky problem to deal with. > > > > ... so may be we can have per-CPU printk kthreads then > > static DEFINE_PER_CPU(struct task_struct *, printk_kthread); > > > SMP hotplug threads, to be precise, the same way as watchdog has it. and > then during offloading we can wake_up any printk_kthread that is knowingly > not from this-CPU, all of them, let them compete for the console_sem. ^^^ *OR* all of them -ss