From: Jan Kara <jack@suse.cz>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
pmladek@suse.cz, Frederic Weisbecker <fweisbec@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>, Jan Kara <jack@suse.cz>
Subject: Re: [PATCH 0/8 v4] printk: Cleanups and softlockup avoidance
Date: Tue, 8 Apr 2014 16:27:26 +0200 [thread overview]
Message-ID: <20140408142726.GB9551@quack.suse.cz> (raw)
In-Reply-To: <1395770101-24534-1-git-send-email-jack@suse.cz>
On Tue 25-03-14 18:54:53, Jan Kara wrote:
> Hello,
>
> this is another revision of the printk softlockup series.
>
> Changes since v3:
> Fixed bogus warning in console_try_lock_spin() in non-preemptible kernels.
> Fixed infinite loop in console_flush() when console was suspended.
>
> Changes since v2:
> I have fixed up some small problems pointed out by Andrew, added possibility to
> configure out the printk offloading logic (for small systems), and offload
> kthreads are now started only once printk.offload_chars is set to value > 0.
>
> Intro for the newcomers to the series below.
Ping Andrew?
Honza
>
> ---
>
> Currently, console_unlock() prints messages from kernel printk buffer to
> console while the buffer is non-empty. When serial console is attached,
> printing is slow and thus other CPUs in the system have plenty of time
> to append new messages to the buffer while one CPU is printing. Thus the
> CPU can spend unbounded amount of time doing printing in console_unlock().
> This is especially serious since vprintk_emit() calls console_unlock()
> with interrupts disabled.
>
> In practice users have observed a CPU can spend tens of seconds printing
> in console_unlock() (usually during boot when hundreds of SCSI devices
> are discovered) resulting in RCU stalls (CPU doing printing doesn't
> reach quiescent state for a long time), softlockup reports (IPIs for the
> printing CPU don't get served and thus other CPUs are spinning waiting
> for the printing CPU to process IPIs), and eventually a machine death
> (as messages from stalls and lockups append to printk buffer faster than
> we are able to print). So these machines are unable to boot with serial
> console attached. Also during artificial stress testing SATA disk
> disappears from the system because its interrupts aren't served for too
> long.
>
> This is a revised series using my new approach to the problem which doesn't
> let CPU out of console_unlock() until there's someone else to take over the
> printing. The main difference since the last version is that instead of
> passing printing duty to different CPUs via IPIs we use dedicated kthreads.
> This method is somewhat less reliable (in a sense that there are more
> situations in which handover needn't work at all - e.g. when the currently
> printing CPU holds a spinlock and the CPU where kthread is scheduled to run is
> spinning on this spinlock) but the code is much simpler and in my practical
> testing kthread approach was good enough to avoid any problems (with one
> exception - see patch 8/8).
>
> Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2014-04-08 14:27 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-25 17:54 [PATCH 0/8 v4] printk: Cleanups and softlockup avoidance Jan Kara
2014-03-25 17:54 ` [PATCH 1/8] printk: Remove outdated comment Jan Kara
2014-03-25 17:54 ` [PATCH 2/8] printk: Release lockbuf_lock before calling console_trylock_for_printk() Jan Kara
2014-04-23 20:56 ` Andrew Morton
2014-04-24 10:18 ` Jan Kara
2014-03-25 17:54 ` [PATCH 3/8] printk: Enable interrupts " Jan Kara
2014-03-25 17:54 ` [PATCH 4/8] printk: Remove separate printk_sched buffers and use printk buf instead Jan Kara
2014-05-05 18:37 ` Steven Rostedt
2014-03-25 17:54 ` [PATCH 5/8] printk: Hand over printing to console if printing too long Jan Kara
2014-03-25 17:54 ` [PATCH 6/8] printk: Start printing handover kthreads on demand Jan Kara
2014-03-26 17:16 ` One Thousand Gnomes
2014-03-26 19:06 ` Jan Kara
2014-03-25 17:55 ` [PATCH 7/8] kernel: Avoid softlockups in stop_machine() during heavy printing Jan Kara
2014-03-25 17:55 ` [PATCH 8/8] printk: Add config option for disabling printk offloading Jan Kara
2014-03-26 17:23 ` One Thousand Gnomes
2014-03-26 19:28 ` Jan Kara
2014-04-18 18:54 ` Andrew Morton
2014-04-22 10:22 ` One Thousand Gnomes
2014-04-23 11:08 ` Jan Kara
2014-04-23 12:35 ` One Thousand Gnomes
2014-04-23 14:29 ` Jan Kara
2014-04-23 18:17 ` Andrew Morton
2014-04-23 21:16 ` One Thousand Gnomes
2014-04-23 21:41 ` Jiri Kosina
2014-04-24 14:00 ` One Thousand Gnomes
2014-05-15 21:28 ` Jan Kara
2014-04-23 9:30 ` Jan Kara
2014-04-08 14:27 ` Jan Kara [this message]
2014-04-08 19:02 ` [PATCH 0/8 v4] printk: Cleanups and softlockup avoidance Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140408142726.GB9551@quack.suse.cz \
--to=jack@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.cz \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).