From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: Petr Mladek <pmladek@suse.com>, Nigel Croxon <ncroxon@redhat.com>,
"Theodore Y. Ts'o" <tytso@mit.edu>,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Steven Rostedt <rostedt@goodmis.org>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
dm-devel@redhat.com, Mikulas Patocka <mpatocka@redhat.com>,
linux-serial@vger.kernel.org
Subject: Re: Serial console is causing system lock-up
Date: Tue, 12 Mar 2019 11:32:31 +0900 [thread overview]
Message-ID: <20190312023231.GA4146@jagdpanzerIV> (raw)
In-Reply-To: <87r2biojcx.fsf@linutronix.de>
On (03/07/19 15:21), John Ogness wrote:
> > John, sorry to ask this, does new printk() design always provide
> > latency guarantees good enough for PREEMPT_RT?
>
> Yes, because it is assumed that emergency messages will never occur for
> a correctly running system.
>
[..]
> Obviously as soon as any emergency message appears, an _unacceptable_
> latency occurs. But that is considered OK because the system is no
> longer running correctly and it is worth the price to pay to get those
> messages with such high reliability.
OK, so what *I'm learning* from this bug report:
10) WARN/ERR messages do not necessarily tell us that the stability of the
system was jeopardized. The system can "run correctly" and be
"perfectly healthy".
20) We can have N CPUs reporting issues simultaneously. Even in production.
Such patterns exist in the kernel.
30) The "reporting part" - printk()->call_console_drivers() - can be the
slowest one.
In this particular case, given that Mikulas saw dropped messages,
checksum calculation was significantly faster than call_console_drivers().
Now, suppose we have new printk, and suppose we have CPUs A B C D, each of
them reports a checksum error:
A prb_lock owner B prb_lock C prb_lock D prb_lock
A calls call_console_drivers, unlocks prb_lock
B grabs prb_lock
B calls call_console_drivers
A calculates new checksum mismatch
A calls printk and spins on prb_lock, behind D
So now we have:
B prb_lock owner C prb_lock D prb_lock A prb_lock
And so on
B C D A -> C D A B -> D A B C -> A B C D -> ...
After M rounds of error reporting (M > N), each CPU, had have to busy
wait M times (N - 1). Sounds quadratic.
40) goto 10
So I have some doubts regarding some of assumptions behind new printk
design. And the problem is not in prb_lock() unfairness. Current printk
design does look to me SMP-friendly; yes, it has unbound printing loop;
that can be addressed. But it doesn't turn SMP system into UP.
-ss
next prev parent reply other threads:[~2019-03-12 2:32 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-06 14:27 Serial console is causing system lock-up Mikulas Patocka
2019-03-06 15:22 ` Petr Mladek
2019-03-06 16:07 ` Mikulas Patocka
2019-03-06 16:30 ` Theodore Y. Ts'o
2019-03-06 17:11 ` Mikulas Patocka
2019-03-06 22:19 ` Steven Rostedt
2019-03-06 22:43 ` John Ogness
2019-03-07 2:22 ` Sergey Senozhatsky
2019-03-07 8:17 ` John Ogness
2019-03-07 8:25 ` Sergey Senozhatsky
2019-03-07 8:34 ` John Ogness
2019-03-07 9:17 ` Sergey Senozhatsky
2019-03-07 10:37 ` John Ogness
2019-03-07 12:26 ` Sergey Senozhatsky
2019-03-07 12:54 ` Mikulas Patocka
2019-03-07 14:21 ` John Ogness
2019-03-07 15:35 ` Petr Mladek
2019-03-12 2:32 ` Sergey Senozhatsky [this message]
2019-03-12 8:17 ` John Ogness
2019-03-12 8:59 ` Sergey Senozhatsky
2019-03-12 10:05 ` Mikulas Patocka
2019-03-12 13:19 ` John Ogness
2019-03-12 13:44 ` Petr Mladek
2019-03-12 12:08 ` Petr Mladek
2019-03-12 15:19 ` John Ogness
2019-03-13 2:38 ` Sergey Senozhatsky
2019-03-13 8:43 ` John Ogness
2019-03-14 10:30 ` Sergey Senozhatsky
2019-03-07 14:08 ` John Stoffel
2019-03-07 14:26 ` Mikulas Patocka
2019-03-08 1:22 ` Sergey Senozhatsky
2019-03-08 1:39 ` Sergey Senozhatsky
2019-03-08 2:36 ` John Ogness
2019-03-07 15:16 ` Petr Mladek
2019-03-07 1:56 ` Sergey Senozhatsky
2019-03-07 13:12 ` Mikulas Patocka
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=20190312023231.GA4146@jagdpanzerIV \
--to=sergey.senozhatsky.work@gmail.com \
--cc=dm-devel@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=john.ogness@linutronix.de \
--cc=linux-serial@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=ncroxon@redhat.com \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.com \
--cc=tytso@mit.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.