mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Dmitry Safonov <0x7f454c46@gmail.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Peter Zijlstra <peterz@infradead.org>,
	Marco Elver <elver@google.com>,
	Alexander Potapenko <glider@google.com>,
	Stephen Boyd <swboyd@chromium.org>
Subject: Re: [PATCH next v2 1/2] dump_stack: move cpu lock to printk.c
Date: Tue, 8 Jun 2021 16:54:58 +0200	[thread overview]
Message-ID: <YL+EwqLO8KsGqQVm@alley> (raw)
In-Reply-To: <878s3kihpk.fsf@jogness.linutronix.de>

On Tue 2021-06-08 15:55:35, John Ogness wrote:
> On 2021-06-08, Petr Mladek <pmladek@suse.com> wrote:
> > Reviewed-by: Petr Mladek <pmladek@suse.com>
> >
> >> --- a/kernel/printk/printk.c
> >> +++ b/kernel/printk/printk.c
> >> @@ -3532,3 +3532,78 @@ void kmsg_dump_rewind(struct kmsg_dump_iter *iter)
> >> +void printk_cpu_lock_irqsave(bool *lock_flag, unsigned long *irq_flags)
> >> +{
> >> +	int old;
> >> +	int cpu;
> >> +
> >> +retry:
> >> +	local_irq_save(*irq_flags);
> >> +
> >> +	cpu = smp_processor_id();
> >> +
> >> +	old = atomic_cmpxchg(&printk_cpulock_owner, -1, cpu);
> >> +	if (old == -1) {
> >> +		/* This CPU is now the owner. */
> >> +
> >
> > Superfluous space?
> 
> I was concerned that people may associate the comment with the following
> line of code. Especially in the next patch when many more lines are
> added. The comment is for the whole conditional block.
> 
> >> +		*lock_flag = true;
> >
> > The original name name "was_locked" was more descriptive. I agree that
> > it was not good for an API. What about keeping the inverted logic and
> > calling it "lock_nested" ?
> >
> > I do not resist on any change. The logic is trivial so...
> 
> I wanted it to be an opaque variable, which is why it is named so. But I
> can rename it for v3. There is no need to debate naming here.

Yup. I didn't want to block the patch because of this. I mentioned it
just for case v3 was needed and you agreed. Feel free to keep your
preferred names and spacing. I am not going to fight over it.

Best Regards,
Petr

  reply	other threads:[~2021-06-08 14:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 20:02 [PATCH next v2 0/2] introduce printk cpu lock John Ogness
2021-06-07 20:02 ` [PATCH next v2 1/2] dump_stack: move cpu lock to printk.c John Ogness
2021-06-08  2:43   ` kernel test robot
2021-06-08 13:48     ` Petr Mladek
2021-06-10 13:26       ` John Ogness
2021-06-11  7:00         ` Petr Mladek
2021-06-08 11:40   ` Petr Mladek
2021-06-08 13:55     ` John Ogness
2021-06-08 14:54       ` Petr Mladek [this message]
2021-06-07 20:02 ` [PATCH next v2 2/2] printk: fix cpu lock ordering John Ogness
2021-06-08 12:55   ` Petr Mladek
2021-06-08 14:18     ` John Ogness
2021-06-08 14:49       ` Petr Mladek
2021-06-10 14:44         ` 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=YL+EwqLO8KsGqQVm@alley \
    --to=pmladek@suse.com \
    --cc=0x7f454c46@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=sfr@canb.auug.org.au \
    --cc=swboyd@chromium.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®