Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753178AbbHGMAy (ORCPT ); Fri, 7 Aug 2015 08:00:54 -0400 Received: from mail.bmw-carit.de ([62.245.222.98]:36517 "EHLO mail.bmw-carit.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750811AbbHGMAw (ORCPT ); Fri, 7 Aug 2015 08:00:52 -0400 X-CTCH-RefID: str=0001.0A0C0204.55C49DF0.02AD,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Subject: Re: [RFC v0 0/3] Simple wait queue support To: , References: <1438781448-10760-1-git-send-email-daniel.wagner@bmw-carit.de> <55C4534F.9040409@bmw-carit.de> CC: , , , , , From: Daniel Wagner X-Enigmail-Draft-Status: N1110 Message-ID: <55C49DF0.4000007@bmw-carit.de> Date: Fri, 7 Aug 2015 14:00:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55C4534F.9040409@bmw-carit.de> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2154 Lines: 62 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); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/