From: Petr Mladek <pmladek@suse.com>
To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Jan Kara <jack@suse.cz>, Kay Sievers <kay@vrfy.org>,
Tejun Heo <tj@kernel.org>, Calvin Owens <calvinowens@fb.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH][RFC] printk: make pr_cont buffer per-cpu
Date: Thu, 25 Aug 2016 23:33:33 +0200 [thread overview]
Message-ID: <20160825213333.GC2273@dhcp128.suse.cz> (raw)
In-Reply-To: <20160825212740.GB2273@dhcp128.suse.cz>
On Thu 2016-08-25 23:27:40, Petr Mladek wrote:
> On Wed 2016-08-24 23:27:29, Sergey Senozhatsky wrote:
> > On (08/24/16 10:19), Petr Mladek wrote:
> > > > On (08/23/16 13:47), Petr Mladek wrote:
> > > > [..]
> > > > > > if (!(lflags & LOG_NEWLINE)) {
> > > > > > + if (!this_cpu_read(cont_printing)) {
> > > > > > + if (system_state == SYSTEM_RUNNING) {
> > > > > > + this_cpu_write(cont_printing, true);
> > > > > > + preempt_disable();
> > > > > > + }
> > > > > > + }
> > > > >
> > > > > I am afraid that this is not acceptable. It means that printk() will have
> > > > > an unexpected side effect. The missing "\n" at the end of a printed
> > > > > string would disable preemption. See below for more.
> > > >
> > > > missing '\n' must WARN about "sched while atomic" eventually, so it
> > > > shouldn't go unnoticed or stay hidden.
> > >
> > > Well, it will still force people to rebuilt a test kernel because they
> > > forget to use '\n" and the test kernel is unusable.
> >
> > you are right. misusage of printk() will now force user to go and fix
> > it. the kernel most likely will be rebuilt anyway - there is a missing
> > \n after all.
> Of course, it would be great to fix it transparently. But if there must
> be a burden, I would prefer to keep it on the "corner" case users
> rather than to push it on everyday users.
Not to say that a messed log is much less painful than a locked system.
Best Regards,
Petr
prev parent reply other threads:[~2016-08-25 21:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-22 15:40 [PATCH][RFC] printk: make pr_cont buffer per-cpu Sergey Senozhatsky
2016-08-22 16:10 ` Joe Perches
2016-08-23 1:10 ` Sergey Senozhatsky
2016-08-23 5:18 ` Sergey Senozhatsky
2016-08-23 11:47 ` Petr Mladek
2016-08-24 1:14 ` Sergey Senozhatsky
2016-08-24 8:19 ` Petr Mladek
2016-08-24 14:27 ` Sergey Senozhatsky
2016-08-25 21:27 ` Petr Mladek
2016-08-25 21:33 ` Petr Mladek [this message]
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=20160825213333.GC2273@dhcp128.suse.cz \
--to=pmladek@suse.com \
--cc=akpm@linux-foundation.org \
--cc=calvinowens@fb.com \
--cc=jack@suse.cz \
--cc=kay@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sergey.senozhatsky.work@gmail.com \
--cc=sergey.senozhatsky@gmail.com \
--cc=tj@kernel.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