Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1346790 > unrolled thread
| Started by | Denys Vlasenko <vda.linux@googlemail.com> |
|---|---|
| First post | 2016-03-01 18:30 +0100 |
| Last post | 2016-03-02 10:40 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 1/7] printk: Hand over printing to console if printing too long Denys Vlasenko <vda.linux@googlemail.com> - 2016-03-01 18:30 +0100
Re: [PATCH 1/7] printk: Hand over printing to console if printing too long Jan Kara <jack@suse.cz> - 2016-03-02 10:40 +0100
| From | Denys Vlasenko <vda.linux@googlemail.com> |
|---|---|
| Date | 2016-03-01 18:30 +0100 |
| Subject | Re: [PATCH 1/7] printk: Hand over printing to console if printing too long |
| Message-ID | <r7Whr-3Ha-15@gated-at.bofh.it> |
On Mon, Oct 26, 2015 at 5:52 AM, Jan Kara <jack@suse.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?
[toc] | [next] | [standalone]
| From | Jan Kara <jack@suse.cz> |
|---|---|
| Date | 2016-03-02 10:40 +0100 |
| Subject | Re: [PATCH 1/7] printk: Hand over printing to console if printing too long |
| Message-ID | <r8bqa-5KC-7@gated-at.bofh.it> |
| In reply to | #1346790 |
On Tue 01-03-16 18:22:25, Denys Vlasenko wrote: > On Mon, Oct 26, 2015 at 5:52 AM, Jan Kara <jack@suse.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? Probably we'll go with workqueue in the next version of the patch series. But at least in this version you needed two tasks so that one task can hand over printing to the other one and thus relieve the load from a CPU. Honza -- Jan Kara <jack@suse.com> SUSE Labs, CR
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web