From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424027AbdEYMLN (ORCPT ); Thu, 25 May 2017 08:11:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:52321 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1765564AbdEYMLM (ORCPT ); Thu, 25 May 2017 08:11:12 -0400 Date: Thu, 25 May 2017 14:11:07 +0200 From: Petr Mladek To: Sergey Senozhatsky Cc: Steven Rostedt , Jan Kara , 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, Sergey Senozhatsky Subject: Re: [RFC][PATCHv3 1/5] printk: move printk_pending out of per-cpu Message-ID: <20170525121107.GG26699@pathway.suse.cz> References: <20170509082859.854-1-sergey.senozhatsky@gmail.com> <20170509082859.854-2-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170509082859.854-2-sergey.senozhatsky@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 2017-05-09 17:28:55, Sergey Senozhatsky wrote: > Do not keep `printk_pending' in per-CPU area. We set the following bits > of printk_pending: > a) PRINTK_PENDING_WAKEUP > when we need to wakeup klogd > b) PRINTK_PENDING_OUTPUT > when there is a pending output from deferred printk and we need > to call console_unlock(). > > So none of the bits control/represent a state of a particular CPU and, > basically, they should be global instead. > > Besides we will use `printk_pending' to control printk kthread, so this > patch is also a preparation work. > > Signed-off-by: Sergey Senozhatsky > Suggested-by: Petr Mladek > --- > kernel/printk/printk.c | 26 ++++++++++++-------------- > 1 file changed, 12 insertions(+), 14 deletions(-) > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index a1aecf44ab07..2cb7f4753b76 100644 > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -401,6 +401,14 @@ DEFINE_RAW_SPINLOCK(logbuf_lock); > printk_safe_exit_irqrestore(flags); \ > } while (0) > > +/* > + * Delayed printk version, for scheduler-internal messages: > + */ > +#define PRINTK_PENDING_WAKEUP 0x01 > +#define PRINTK_PENDING_OUTPUT 0x02 > + > +static unsigned long printk_pending; > + > #ifdef CONFIG_PRINTK The variable is used only when CONFIG_PRINTK is defined at the moment, so this produces a warning about an unused variable. Otherwise, the patch looks fine to me. Best Regards, Petr