From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753177AbdDDJgr (ORCPT ); Tue, 4 Apr 2017 05:36:47 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:34697 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752518AbdDDJgq (ORCPT ); Tue, 4 Apr 2017 05:36:46 -0400 Date: Tue, 4 Apr 2017 18:36:45 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Jan Kara , Andrew Morton , Linus Torvalds , Peter Zijlstra , "Rafael J . Wysocki" , Eric Biederman , Greg Kroah-Hartman , Jiri Slaby , Pavel Machek , Len Brown , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [RFC][PATCHv2 2/8] printk: introduce printing kernel thread Message-ID: <20170404093645.GD470@jagdpanzerIV.localdomain> References: <20170329092511.3958-1-sergey.senozhatsky@gmail.com> <20170329092511.3958-3-sergey.senozhatsky@gmail.com> <20170404090120.GH29537@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170404090120.GH29537@pathway.suse.cz> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (04/04/17 11:01), Petr Mladek wrote: [..] > > +static atomic_t printk_emergency __read_mostly; > > +/* > > + * Disable printk_kthread permanently. Unlike `oops_in_progress' > > + * it doesn't go back to 0. > > + */ > > The comment is not valid once we allow to modify the variable using > the sysfs knob. it's updated in that patch (sysfs knob introduction). [..] > > @@ -2182,6 +2253,7 @@ void console_unlock(void) > > console_may_schedule = 0; > > > > again: > > + clear_bit(PRINTK_PENDING_OUTPUT, &printk_pending); > > This will not help if new messages appear during > call_console_drivers(). you are right. wouldn't do much harm (an extra console_unlock() from printk_kthread in the worst case), but agree. I added it there because of that "!can_use_console()" branch. not that I expect printk_kthread being executed on !online CPU, but we might have no callable consoles. probably should have that clear_bit() before and after the loop. -ss