From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: linux-kernel@vger.kernel.org, Dennis Zhou <dennis@kernel.org>,
Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@linux.com>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] percpu-refcount: Use normal instead of RCU-sched"
Date: Wed, 2 Oct 2019 17:17:19 +0200 [thread overview]
Message-ID: <20191002151718.eicbn4ahdanwuggh@linutronix.de> (raw)
In-Reply-To: <20191002150852.GB2689@paulmck-ThinkPad-P72>
On 2019-10-02 08:08:52 [-0700], Paul E. McKenney wrote:
> On Wed, Oct 02, 2019 at 01:22:53PM +0200, Sebastian Andrzej Siewior wrote:
> > This is a revert of commit
> > a4244454df129 ("percpu-refcount: use RCU-sched insted of normal RCU")
> >
> > which claims the only reason for using RCU-sched is
> > "rcu_read_[un]lock() … are slightly more expensive than preempt_disable/enable()"
> >
> > and
> > "As the RCU critical sections are extremely short, using sched-RCU
> > shouldn't have any latency implications."
> >
> > The problem with using RCU-sched here is that it disables preemption and
> > the callback must not acquire any sleeping locks like spinlock_t on
> > PREEMPT_RT which is the case with some of the users.
>
> Looks good in general, but changing to RCU-preempt does not change the
> fact that the callbacks execute with bh disabled. There is a newish
> queue_rcu_work() that invokes a workqueue handler after a grace period.
>
> Or am I missing your point here?
That is fine, no the RCU callback. The problem is that
percpu_ref_put_many() as of now does:
rcu_read_lock_sched(): /* aka preempt_disable(); */
if (__ref_is_percpu(ref, &percpu_count))
this_cpu_sub(*percpu_count, nr);
else if (unlikely(atomic_long_sub_and_test(nr, &ref->count)))
ref->release(ref);
and then the callback invoked via ref->release() acquires a spinlock_t
with disabled preemption.
> Thanx, Paul
Sebastian
next prev parent reply other threads:[~2019-10-02 15:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-02 11:22 Sebastian Andrzej Siewior
2019-10-02 15:08 ` Paul E. McKenney
2019-10-02 15:17 ` Sebastian Andrzej Siewior [this message]
2019-11-07 9:13 ` Sebastian Andrzej Siewior
2019-11-07 16:17 ` Dennis Zhou
2019-11-07 16:28 ` Sebastian Andrzej Siewior
2019-11-07 16:55 ` Dennis Zhou
2019-11-07 17:24 ` Sebastian Andrzej Siewior
2019-11-07 17:36 ` Dennis Zhou
2019-11-08 17:35 ` [PATCH v2] " Sebastian Andrzej Siewior
2019-11-08 18:17 ` Christopher Lameter
2019-11-11 10:44 ` Sebastian Andrzej Siewior
2019-11-11 13:38 ` Paul E. McKenney
2019-11-17 4:11 ` Dennis Zhou
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=20191002151718.eicbn4ahdanwuggh@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=cl@linux.com \
--cc=dennis@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.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
all inboxes | Powered by JetHome®