Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1650445

Re: [RFC][PATCHv3 1/5] printk: move printk_pending out of per-cpu

From Petr Mladek <pmladek@suse.com>
Newsgroups linux.kernel
Subject Re: [RFC][PATCHv3 1/5] printk: move printk_pending out of per-cpu
Date 2017-05-25 14:20 +0200
Message-ID <tKZUd-86e-3@gated-at.bofh.it> (permalink)
References <tF8Qy-7He-5@gated-at.bofh.it> <tF8Qz-7He-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <sergey.senozhatsky@gmail.com>
> Suggested-by: Petr Mladek <pmladek@suse.com>
> ---
>  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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [RFC][PATCHv3 1/5] printk: move printk_pending out of per-cpu Petr Mladek <pmladek@suse.com> - 2017-05-25 14:20 +0200
  Re: [RFC][PATCHv3 1/5] printk: move printk_pending out of per-cpu Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-05-25 14:40 +0200
    Re: [RFC][PATCHv3 1/5] printk: move printk_pending out of per-cpu Petr Mladek <pmladek@suse.com> - 2017-05-25 14:50 +0200

csiph-web