All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, rcu@vger.kernel.org
Subject: Re: [PATCH 3/3] rcu: Assume rcu_report_dead() always deals with local CPU
Date: Thu, 20 May 2021 02:54:26 +0200	[thread overview]
Message-ID: <20210520005426.GB22836@lothringen> (raw)
In-Reply-To: <20210519185107.GB4441@paulmck-ThinkPad-P17-Gen-1>

On Wed, May 19, 2021 at 11:51:07AM -0700, Paul E. McKenney wrote:
> On Wed, May 19, 2021 at 02:09:30AM +0200, Frederic Weisbecker wrote:
> > rcu_report_dead() is always called locally from the idle path. Passing
> > a CPU number to it suggests otherwise and is rather error-prone as the
> > code inside relies on locality.
> > 
> > Robustify the function prototype and refine the name along the way.
> > 
> > Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
> 
> Makes a lot of sense, thank you!
> 
> On the function name, here is the list:
> 
> int rcutree_prepare_cpu(unsigned int cpu) -- notifier from any CPU.
> void rcu_cpu_starting(unsigned int cpu) -- direct call on incoming CPU.
> int rcutree_online_cpu(unsigned int cpu) -- notifier from any CPU.
> 
> int rcutree_offline_cpu(unsigned int cpu) -- notifier from any CPU.
> void rcu_report_dead(unsigned int cpu) -- direct call on outgoing CPU.
> void rcutree_migrate_callbacks(int cpu) -- direct call from surviving CPU.
> int rcutree_dead_cpu(unsigned int cpu) -- notifier from any CPU.
> 
> Note that rcu_report_dead() can also be invoked from cpu_die_early() on
> other CPU when onlining a CPU fails.  This happens on arm64.  Which might
> be an arm64 bug, but unless I am missing something it is a case where
> rcu_report_dead() is called non-locally.

Hmm, I see it only called with smp_processor_id() from cpu_die_early().

> 
> And the naming is currently a bit random, isn't it?  :-/
> 
> Maybe rcutree_*_cpu() if there is a CPU parameter and rcutree_*_self()
> if all calls run on the CPU in question?

Makes sense. Or rcutree_*_curr_cpu() but it's going to produce long names.


> I cannot immediately think of a reason to make names reflect whether
> the corresponding functions are directly called or are called via notifier.
> Thoughts?

No indeed, let's wait for some convention to ever emerge :)

Thanks!

  reply	other threads:[~2021-05-20  0:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19  0:09 [PATCH 0/3] rcu/nocb cleanups Frederic Weisbecker
2021-05-19  0:09 ` [PATCH 1/3] rcu/nocb: Start moving nocb code to its own plugin file Frederic Weisbecker
2021-05-19 15:55   ` Paul E. McKenney
2021-05-20  1:02     ` Frederic Weisbecker
2021-05-20  4:54       ` Paul E. McKenney
2021-05-19  0:09 ` [PATCH 2/3] rcu/nocb: Remove NOCB deferred wakeup from rcutree_dead_cpu() Frederic Weisbecker
2021-05-19 15:59   ` Paul E. McKenney
2021-05-20  0:25     ` Frederic Weisbecker
2021-05-20  0:34       ` Paul E. McKenney
2021-05-19  0:09 ` [PATCH 3/3] rcu: Assume rcu_report_dead() always deals with local CPU Frederic Weisbecker
2021-05-19 18:51   ` Paul E. McKenney
2021-05-20  0:54     ` Frederic Weisbecker [this message]
2021-05-20  4:54       ` Paul E. McKenney

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=20210520005426.GB22836@lothringen \
    --to=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=rcu@vger.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 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.