Re: [PATCH v11 3/3] printk: make printk.synchronous param rw

From: Sergey Senozhatsky
Date: Fri Apr 22 2016 - 08:14:45 EST


Hello,

On (04/22/16 10:41), Petr Mladek wrote:
> Ah, I see and feel shame. It is actually explained in the comment
> above printk_initcall_done declaration. Well, the explanation confused
> me a bit ;-) I suggest to change it sligtly:
>
> /*
> * printk_sync_set() can be called from two places:
> *
> * - early from start_kernel()->parse_args(). But we can't kthread_run()
> * at this stage, so we just set the param value. The actual
> * initalization happens later, from the late_initcall().
> *
> * - even later from user space via sysfs knob. We can kthread_run()
> * there if needed.
> */
>
> Or we could write this even more explicitely:
>
> /*
> * Prevent starting kthreads from start_kernel()->parse_args(). It is not
> * possible at this stage. Instead do so via the inticall.
> */
> static bool printk_initcall_done;

will take a look, thanks!

> In each case, I would move the comment and the declaration right above the
> printk_sync_set().

I'm also thinking about renaming it to `printk_kthread_can_run', feels
like this name gives better description.

will resend shortly.

-ss