Re: [RFC][PATCH v2 1/2] printk: Make printk() completely async

From: Sergey Senozhatsky
Date: Sun Mar 06 2016 - 01:31:58 EST


On (03/05/16 19:55), Sergey Senozhatsky wrote:
[..]
> +static int __init init_printk_workqueue(void)
> +{
> + if (printk_sync)
> + return 0;
> +
> + printk_wq = alloc_workqueue("printk_wq", WQ_MEM_RECLAIM, 0);
> + /*
> + * Fallback to one of system-wide workqueues if we failed to
> + * allocate a dedicated one. console_unlock() may take some
> + * time to flush all of the messages, so we better use
> + * system_long_wq.
> + */
> + if (!printk_wq) {
> + pr_err("printk: Fallback to system_long workqueue\n");
> + printk_wq = system_long_wq;
> + }
> +
> + return 0;
> +}
> +early_initcall(init_printk_workqueue);
^^^^^^
better be late_initcall(). init_workqueues(), which creates pwq_cache kmem_cache,
is early initcall.

===8<===8<===8<====