linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Michal Hocko <mhocko@suse.com>
Cc: John Ogness <john.ogness@linutronix.de>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] printk: Enough to disable preemption in printk deferred context
Date: Wed, 19 Apr 2023 12:31:44 +0200	[thread overview]
Message-ID: <ZD_DED6ttnLvUJsI@alley> (raw)
In-Reply-To: <ZD+lBU1PGkLadDMT@dhcp22.suse.cz>

On Wed 2023-04-19 10:23:33, Michal Hocko wrote:
> On Wed 19-04-23 09:42:10, Petr Mladek wrote:
> > The comment above printk_deferred_enter()/exit() definition claims
> > that it can be used only when interrupts are disabled.
> > 
> > It was required by the original printk_safe_log_store() implementation.
> > The code provided lockless synchronization between a single writer and
> > a single reader. The interrupt and the normal context shared the same
> > buffer.
> > 
> > The commit 93d102f094be ("printk: remove safe buffers") removed
> > these temporary buffers. Instead, the messages are stored directly into
> > the new global lockless buffer which supports multiple parallel writers.
> > 
> > As a result, it is safe to interrupt one writer now. The preemption still
> > has to be disabled because the deferred context is CPU specific.
> 
> Thanks for the clarification and explanation.
> 
> > Fixes: 93d102f094be ("printk: remove safe buffers")
> 
> Is this a fix though? I would expect some users to be changed from irq
> to preempt to disabling to be considered a fix.

Yeah, I am not sure about the Fixes tag either. I wanted to cross-link
the two commits. But it is probably enough to mention it in the commit
message.

Best Regards,
Petr


  reply	other threads:[~2023-04-19 10:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-19  7:42 [PATCH] printk: Enough to disable preemption in printk deferred context Petr Mladek
2023-04-19  8:23 ` Sergey Senozhatsky
2023-04-19  8:23 ` Michal Hocko
2023-04-19 10:31   ` Petr Mladek [this message]
2023-04-19  9:05 ` John Ogness
2023-04-19 12:03   ` Petr Mladek
2023-04-19 12:14     ` Michal Hocko
2023-04-19 13:45     ` John Ogness

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=ZD_DED6ttnLvUJsI@alley \
    --to=pmladek@suse.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.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).