From: Petr Mladek <pmladek@suse.com>
To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] printk: CON_PRINTBUFFER console registration is a bit racy
Date: Wed, 26 Sep 2018 13:37:15 +0200 [thread overview]
Message-ID: <20180926113715.6llme2vmvynzuoa3@pathway.suse.cz> (raw)
In-Reply-To: <20180914111953.GA20572@tigerII.localdomain>
On Fri 2018-09-14 20:19:53, Sergey Senozhatsky wrote:
> On (09/14/18 10:59), Petr Mladek wrote:
> >
> > Well, I am not sure if it is worth the code complexity.
> >
>
> Well, I don't think we need to bother that much here. Besides,
> exclusive_console is cleared under logbuf_lock with preemption
> disabled now. So we set it under logbuf_lock and !irq and we
> clear it under logbuf_lock and !irq. Looks quite OK to me.
I wanted to say that you moved exclusive_console handling under
a locked section from a reason. This reason is far from clear
from the code.
If you really want this change, please add a comment, for example:
/*
* Set exclusive_console still with disabled interrupts to
* reduce race window with eventual console_flush_on_panic()
* that ignores console_lock.
*/
I am not against the change. It makes some sense and it does
not break anything. It is just not obvious and might either
get easily lost again or it might cause confusion. I mean that
it might cause false feeling that exclusive_console is
synchronized by logbuf_lock.
printk code already is complex enough without this subtle
tricks.
Best Regards,
Petr
next prev parent reply other threads:[~2018-09-26 11:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-14 2:34 [PATCH] printk: CON_PRINTBUFFER console registration is a bit racy Sergey Senozhatsky
2018-09-14 8:59 ` Petr Mladek
2018-09-14 11:19 ` Sergey Senozhatsky
2018-09-25 13:00 ` Sergey Senozhatsky
2018-09-26 11:37 ` Petr Mladek [this message]
2018-09-27 10:02 ` Steven Rostedt
2018-09-28 7:36 ` Sergey Senozhatsky
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=20180926113715.6llme2vmvynzuoa3@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky.work@gmail.com \
--cc=sergey.senozhatsky@gmail.com \
/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