From: "Paul E. McKenney" <paulmck@kernel.org>
To: Pingfan Liu <kernelfans@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, rcu <rcu@vger.kernel.org>,
Frederic Weisbecker <frederic@kernel.org>,
Neeraj Upadhyay <quic_neeraju@quicinc.com>,
Josh Triplett <josh@joshtriplett.org>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Joel Fernandes <joel@joelfernandes.org>,
Thomas Gleixner <tglx@linutronix.de>,
Steven Price <steven.price@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@linux.intel.com>,
"Jason A. Donenfeld" <Jason@zx2c4.com>,
boqun.feng@gmail.com
Subject: Re: [RFC 06/10] rcu/hotplug: Make rcutree_dead_cpu() parallel
Date: Tue, 6 Sep 2022 11:45:09 -0700 [thread overview]
Message-ID: <20220906184509.GF4315@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <CAFgQCTuNw3sdO=X1KNHkTZW8YvK8xo4bmTxyN_uJ9=kkWOW=zw@mail.gmail.com>
On Mon, Sep 05, 2022 at 11:53:52AM +0800, Pingfan Liu wrote:
> On Thu, Sep 1, 2022 at 12:15 AM Paul E. McKenney <paulmck@kernel.org> wrote:
> >
> > On Wed, Aug 24, 2022 at 09:20:50AM -0700, Paul E. McKenney wrote:
> > > On Wed, Aug 24, 2022 at 09:53:11PM +0800, Pingfan Liu wrote:
> > > > On Tue, Aug 23, 2022 at 11:01 AM Paul E. McKenney <paulmck@kernel.org> wrote:
> > > > > On Tue, Aug 23, 2022 at 09:50:56AM +0800, Pingfan Liu wrote:
> > > > > > On Sun, Aug 21, 2022 at 07:45:28PM -0700, Paul E. McKenney wrote:
> > > > > > > On Mon, Aug 22, 2022 at 10:15:16AM +0800, Pingfan Liu wrote:
> > > > > > > > In order to support parallel, rcu_state.n_online_cpus should be
> > > > > > > > atomic_dec()
> > > > > > > >
> > > > > > > > Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
> > > > > > >
> > > > > > > I have to ask... What testing have you subjected this patch to?
> > > > > > >
> > > > > >
> > > > > > This patch subjects to [1]. The series aims to enable kexec-reboot in
> > > > > > parallel on all cpu. As a result, the involved RCU part is expected to
> > > > > > support parallel.
> > > > >
> > > > > I understand (and even sympathize with) the expectation. But results
> > > > > sometimes diverge from expectations. There have been implicit assumptions
> > > > > in RCU about only one CPU going offline at a time, and I am not sure
> > > > > that all of them have been addressed. Concurrent CPU onlining has
> > > > > been looked at recently here:
> > > > >
> > > > > https://docs.google.com/document/d/1jymsaCPQ1PUDcfjIKm0UIbVdrJAaGX-6cXrmcfm0PRU/edit?usp=sharing
> > > > >
> > > > > You did us atomic_dec() to make rcu_state.n_online_cpus decrementing be
> > > > > atomic, which is good. Did you look through the rest of RCU's CPU-offline
> > > > > code paths and related code paths?
> > > >
> > > > I went through those codes at a shallow level, especially at each
> > > > cpuhp_step hook in the RCU system.
> > >
> > > And that is fine, at least as a first step.
> > >
> > > > But as you pointed out, there are implicit assumptions about only one
> > > > CPU going offline at a time, I will chew the google doc which you
> > > > share. Then I can come to a final result.
> > >
> > > Boqun Feng, Neeraj Upadhyay, Uladzislau Rezki, and I took a quick look,
> > > and rcu_boost_kthread_setaffinity() seems to need some help. As it
> > > stands, it appears that concurrent invocations of this function from the
> > > CPU-offline path will cause all but the last outgoing CPU's bit to be
> > > (incorrectly) set in the cpumask_var_t passed to set_cpus_allowed_ptr().
> > >
> > > This should not be difficult to fix, for example, by maintaining a
> > > separate per-leaf-rcu_node-structure bitmask of the concurrently outgoing
> > > CPUs for that rcu_node structure. (Similar in structure to the
> > > ->qsmask field.)
> > >
>
> Sorry to reply late, since I am interrupted by some other things.
> I have took a different way and posted a series ([PATCH 1/3] rcu:
> remove redundant cpu affinity setting during teardown) for that on
> https://lore.kernel.org/rcu/20220905033852.18988-1-kernelfans@gmail.com/T/#t
And I took patch #3, thank you!
#1 allows the kthread to run on the outgoing CPU, which is to be
avoided, and #2 depends on #1.
> Besides, for the integration of the concurrency cpu hot-removing into
> the rcu torture test, I begin to do it.
Very good! I am looking forward to seeing what you come up with.
> > > There are probably more where that one came from. ;-)
> >
> > And here is one more from this week's session.
>
> Thanks for the update.
>
> > The calls to tick_dep_set() and tick_dep_clear() use atomic operations,
> > but they operate on a global variable. This means that the first call
> > to rcutree_offline_cpu() would enable the tick and the first call to
> > rcutree_dead_cpu() would disable the tick. This might be OK, but it
> > is at the very least bad practice. There needs to be a counter
> > mediating these calls.
>
> I will see what I can do here.
>
> > For more detail, please see the Google document:
> >
> > https://docs.google.com/document/d/1jymsaCPQ1PUDcfjIKm0UIbVdrJAaGX-6cXrmcfm0PRU/edit?usp=sharing
> >
>
> Have read it and hope that both online and offline concurrency can
> come to true in near future.
Indeed, I suspect that a lot of people would like to see faster kexec!
Thanx, Paul
next prev parent reply other threads:[~2022-09-06 18:45 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-22 2:15 [RFC 00/10] arm64/riscv: Introduce fast kexec reboot Pingfan Liu
2022-08-22 2:15 ` [RFC 01/10] cpu/hotplug: Make __cpuhp_kick_ap() ready for async Pingfan Liu
2022-08-22 2:15 ` [RFC 02/10] cpu/hotplug: Compile smp_shutdown_nonboot_cpus() conditioned on CONFIG_SHUTDOWN_NONBOOT_CPUS Pingfan Liu
2022-08-22 2:15 ` [RFC 03/10] cpu/hotplug: Introduce fast kexec reboot Pingfan Liu
2022-08-22 2:15 ` [RFC 04/10] cpu/hotplug: Check the capability of kexec quick reboot Pingfan Liu
2022-08-22 2:15 ` [RFC 05/10] perf/arm-dsu: Make dsu_pmu_cpu_teardown() parallel Pingfan Liu
2022-08-22 2:15 ` [RFC 06/10] rcu/hotplug: Make rcutree_dead_cpu() parallel Pingfan Liu
2022-08-22 2:45 ` Paul E. McKenney
2022-08-23 1:50 ` Pingfan Liu
2022-08-23 3:01 ` Paul E. McKenney
2022-08-24 13:53 ` Pingfan Liu
2022-08-24 16:20 ` Paul E. McKenney
2022-08-24 17:26 ` Joel Fernandes
2022-08-24 19:21 ` Paul E. McKenney
2022-08-24 22:54 ` Joel Fernandes
2022-08-24 23:01 ` Paul E. McKenney
2022-08-31 16:15 ` Paul E. McKenney
2022-09-05 3:53 ` Pingfan Liu
2022-09-06 18:45 ` Paul E. McKenney [this message]
2022-08-22 18:08 ` Joel Fernandes
2022-08-23 1:56 ` Pingfan Liu
2022-08-23 3:14 ` Joel Fernandes
2022-08-24 13:38 ` Pingfan Liu
2022-08-24 13:44 ` Jason A. Donenfeld
2022-08-22 2:15 ` [RFC 07/10] lib/cpumask: Introduce cpumask_not_dying_but() Pingfan Liu
2022-08-22 14:15 ` Yury Norov
2022-08-23 7:29 ` Pingfan Liu
2022-08-22 2:15 ` [RFC 08/10] cpuhp: Replace cpumask_any_but(cpu_online_mask, cpu) Pingfan Liu
2022-08-22 2:15 ` [RFC 09/10] genirq/cpuhotplug: Ask migrate_one_irq() to migrate to a real online cpu Pingfan Liu
2022-08-22 2:15 ` [RFC 10/10] arm64: smp: Make __cpu_disable() parallel Pingfan Liu
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=20220906184509.GF4315@paulmck-ThinkPad-P17-Gen-1 \
--to=paulmck@kernel.org \
--cc=Jason@zx2c4.com \
--cc=boqun.feng@gmail.com \
--cc=frederic@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=kernelfans@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=quic_neeraju@quicinc.com \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=steven.price@arm.com \
--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;
as well as URLs for NNTP newsgroup(s).