From: Daniel Wagner <daniel.wagner@bmw-carit.de>
To: <linux-rt-users@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <paul.gortmaker@windriver.com>, <peterz@infradead.org>,
<bigeasy@linutronix.de>, <tglx@linutronix.de>,
<paulmck@linux.vnet.ibm.com>, <rostedt@goodmis.org>
Subject: Re: [RFC v0 0/3] Simple wait queue support
Date: Fri, 7 Aug 2015 14:00:48 +0200 [thread overview]
Message-ID: <55C49DF0.4000007@bmw-carit.de> (raw)
In-Reply-To: <55C4534F.9040409@bmw-carit.de>
On 08/07/2015 08:42 AM, Daniel Wagner wrote:
> On 08/05/2015 03:30 PM, Daniel Wagner wrote:
>> My test system didn't crash or showed any obvious defects, so I
>> decided to apply some benchmarks utilizing mmtests. I have picked some
>
> As it turns out, this is not really true. I forgot to enable lockdep:
[...]
> If I decoded this correctly the call to rcu_future_gp_cleanup() is
> supposed to run with IRQs disabled. swake_up_all() though will reenable the
> IRQs:
>
> rcu_gp_cleanup()
> rcu_for_each_node_breadth_first(rsp, rnp) {
> raw_spin_lock_irq(&rnp->lock);
>
> nocb += rcu_future_gp_cleanup(rsp, rnp);
> raw_spin_unlock_irq(&rnp->lock);
> }
>
> rcu_future_gp_cleanup()
> rcu_nocb_gp_cleanup()
> swake_up_all()
>
>
> With IRQs enabled again and we end up in rcu_process_callbacks
> under SOFTIRQ. rcu_process_callbacks aquires the RCU lock again.
>
> Not sure what to do here.
Not really knowing if this is okay but I think the call to
rcu_nocb_gp_cleanup() inside rcu_future_gp_cleanup() doesn't need to be
protected by rnp->lock. At least lockdep and rcutorture is still happy.
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index d424378..9411fc3 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1569,7 +1569,6 @@ static int rcu_future_gp_cleanup(struct rcu_state
*rsp, struct rcu_node *rnp)
int needmore;
struct rcu_data *rdp = this_cpu_ptr(rsp->rda);
- rcu_nocb_gp_cleanup(rsp, rnp);
rnp->need_future_gp[c & 0x1] = 0;
needmore = rnp->need_future_gp[(c + 1) & 0x1];
trace_rcu_future_gp(rnp, rdp, c,
@@ -1992,6 +1991,7 @@ static void rcu_gp_cleanup(struct rcu_state *rsp)
/* smp_mb() provided by prior unlock-lock pair. */
nocb += rcu_future_gp_cleanup(rsp, rnp);
raw_spin_unlock_irq(&rnp->lock);
+ rcu_nocb_gp_cleanup(rsp, rnp);
cond_resched_rcu_qs();
WRITE_ONCE(rsp->gp_activity, jiffies);
rcu_gp_slow(rsp, gp_cleanup_delay);
next prev parent reply other threads:[~2015-08-07 12:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-05 13:30 [RFC v0 0/3] Simple wait queue support Daniel Wagner
2015-08-05 13:30 ` [RFC v0 1/3] KVM: use simple waitqueue for vcpu->wq Daniel Wagner
2015-08-05 13:30 ` [RFC v0 2/3] sched/completion: convert completions to use simple wait queues Daniel Wagner
2015-08-05 13:30 ` [RFC v0 3/3] rcu: use simple wait queues where possible in rcutree Daniel Wagner
2015-08-06 19:22 ` [RFC v0 0/3] Simple wait queue support Paul Gortmaker
2015-08-06 19:31 ` Steven Rostedt
2015-08-06 21:36 ` Peter Zijlstra
2015-08-06 22:14 ` Steven Rostedt
2015-08-07 9:25 ` Peter Zijlstra
2015-08-07 11:29 ` Steven Rostedt
2015-08-07 6:42 ` Daniel Wagner
2015-08-07 12:00 ` Daniel Wagner [this message]
2015-08-11 6:24 ` Daniel Wagner
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=55C49DF0.4000007@bmw-carit.de \
--to=daniel.wagner@bmw-carit.de \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.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