From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: Tejun Heo <tj@kernel.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
linux-kernel@vger.kernel.org, Boqun Feng <boqun.feng@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
tglx@linutronix.de, Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>
Subject: Re: [PATCH] rcu: Use cpus_read_lock() while looking at cpu_online_mask
Date: Wed, 19 Sep 2018 15:11:40 -0700 [thread overview]
Message-ID: <20180919221140.GH4222@linux.ibm.com> (raw)
In-Reply-To: <20180919205521.GE902964@devbig004.ftw2.facebook.com>
On Wed, Sep 19, 2018 at 01:55:21PM -0700, Tejun Heo wrote:
> Hello,
>
> On Tue, Sep 11, 2018 at 10:02:22AM -0700, Paul E. McKenney wrote:
> > > Doesn't work for me because it is still within the preempt-disable
> > > section :/.
> > > Would it work to use WORK_CPU_UNBOUND? As far as I understand it, the
> > > CPU number does not matter, you just want to spread it across multiple
> > > CPUs in the NUMA case.
> >
> > Locality is a good thing, but yes, something like this?
> >
> > if (!IS_ENABLED(CONFIG_PREEMPT_RT) && /* or whatever it is called */
> > unlikely(cpu > rnp->grphi - rnp->grplo))
> >
> > Another approach that might be better longer term would be to have a
> > workqueue interface that treats the specified CPU as a suggestion,
> > and silently switches to WORK_CPU_UNBOUND if there is any problem
> > whatsoever with the specified CPU. Tejun, Lai, thoughts?
>
> Unbound workqueue is NUMA-affine by default, so using it by default
> might not harm anything.
OK, so the above workaround would function correctly on -rt, thank you!
Sebastian, is there a counterpart to CONFIG_PREEMPT_RT already in
mainline? If so, I would be happy to make mainline safe for -rt.
> Also, per-cpu work items get unbound from
> the cpu if the cpu goes down while the work item is running or queued,
> so it might just work already.
There are race conditions where the work item is queued at an inopportune
time during the offline process, resulting in a splat, hence the need
for a check with preemption disabled in order to synchronize with the
synchronize_sched() in the offline process.
Thanx, Paul
next prev parent reply other threads:[~2018-09-19 22:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-10 13:56 [PATCH] rcu: Use cpus_read_lock() while looking at cpu_online_mask Sebastian Andrzej Siewior
2018-09-11 16:05 ` Paul E. McKenney
2018-09-11 16:21 ` Sebastian Andrzej Siewior
2018-09-11 17:02 ` Paul E. McKenney
2018-09-19 20:55 ` Tejun Heo
2018-09-19 22:11 ` Paul E. McKenney [this message]
2018-10-12 18:41 ` Sebastian Andrzej Siewior
2018-10-13 13:48 ` Paul E. McKenney
2018-10-15 14:42 ` Sebastian Andrzej Siewior
2018-10-15 15:07 ` Boqun Feng
2018-10-15 15:09 ` Sebastian Andrzej Siewior
2018-10-15 15:33 ` Boqun Feng
2018-10-15 16:36 ` 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=20180919221140.GH4222@linux.ibm.com \
--to=paulmck@linux.ibm.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=bigeasy@linutronix.de \
--cc=boqun.feng@gmail.com \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=tj@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 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).