[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK1hOcOzWiO6LR0JJ-MhAL4Js_534WpCX=gcY44=hQ9+3Yfmsw@mail.gmail.com>
Date: Tue, 1 Mar 2016 18:22:25 +0100
From: Denys Vlasenko <vda.linux@...glemail.com>
To: Jan Kara <jack@...e.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>, pmladek@...e.com,
KY Srinivasan <kys@...rosoft.com>,
Steven Rostedt <rostedt@...dmis.org>, Jan Kara <jack@...e.cz>
Subject: Re: [PATCH 1/7] printk: Hand over printing to console if printing too long
On Mon, Oct 26, 2015 at 5:52 AM, Jan Kara <jack@...e.com> wrote:
> This patch implements a mechanism where after printing specified number
> of characters (tunable as a kernel parameter printk.offload_chars), CPU
> doing printing asks for help by waking up one of dedicated kthreads. As
> soon as the printing CPU notices kthread got scheduled and is spinning
> on print_lock dedicated for that purpose, it drops console_sem,
> print_lock, and exits console_unlock(). Kthread then takes over printing
> instead. This way no CPU should spend printing too long even if there
> is heavy printk traffic.
> +/*
> + * Number of kernel threads for offloading printing. We need at least two so
> + * that they can hand over printing from one to another one and thus switch
> + * CPUs.
> + */
> +#define PRINTING_TASKS 2
> +
> +/* Wait queue printing kthreads sleep on when idle */
> +static DECLARE_WAIT_QUEUE_HEAD(print_queue);
Having two tasks, not one, for printking for the case
when console output is slow... sounds wasteful.
Can this be improved so that only one task is needed?
Powered by blists - more mailing lists