From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757518AbbCCRMo (ORCPT ); Tue, 3 Mar 2015 12:12:44 -0500 Received: from e36.co.us.ibm.com ([32.97.110.154]:59841 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756704AbbCCRMk (ORCPT ); Tue, 3 Mar 2015 12:12:40 -0500 Date: Tue, 3 Mar 2015 09:12:32 -0800 From: "Paul E. McKenney" To: Mathieu Desnoyers Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, dvhart@linux.intel.com, fweisbec@gmail.com, oleg@redhat.com, bobby prani Subject: Re: [PATCH tip/core/rcu 6/7] rcu: Move early-boot callbacks to no-CBs lists for no-CBs CPUs Message-ID: <20150303171232.GL15405@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20150303164528.GA6616@linux.vnet.ibm.com> <1425401148-7848-1-git-send-email-paulmck@linux.vnet.ibm.com> <1425401148-7848-6-git-send-email-paulmck@linux.vnet.ibm.com> <1395157403.208223.1425401836167.JavaMail.zimbra@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1395157403.208223.1425401836167.JavaMail.zimbra@efficios.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15030317-0021-0000-0000-000008FB7DCC Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 03, 2015 at 04:57:16PM +0000, Mathieu Desnoyers wrote: > ----- Original Message ----- > > From: "Paul E. McKenney" > > To: linux-kernel@vger.kernel.org > > Cc: mingo@kernel.org, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, "mathieu desnoyers" > > , josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, > > rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, dvhart@linux.intel.com, fweisbec@gmail.com, > > oleg@redhat.com, "bobby prani" , "Paul E. McKenney" > > Sent: Tuesday, March 3, 2015 11:45:47 AM > > Subject: [PATCH tip/core/rcu 6/7] rcu: Move early-boot callbacks to no-CBs lists for no-CBs CPUs > > > > From: "Paul E. McKenney" > > > > When a CPU is first determined to be a no-CBs CPUs, this commit causes > > any early boot callbacks to be moved to the no-CBs callback list, > > allowing them t obe invoked. > ^^^^^ > out-of-order space ;) I clearly needed a typography barrier! ;-) Good catch! Thanx, Paul > Thanks, > > Mathieu > > > > > Signed-off-by: Paul E. McKenney > > --- > > kernel/rcu/tree.c | 1 + > > kernel/rcu/tree_plugin.h | 24 ++++++++++++------------ > > 2 files changed, 13 insertions(+), 12 deletions(-) > > > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > > index 92fd3eab5823..0317bf7d997f 100644 > > --- a/kernel/rcu/tree.c > > +++ b/kernel/rcu/tree.c > > @@ -2851,6 +2851,7 @@ __call_rcu(struct rcu_head *head, void (*func)(struct > > rcu_head *rcu), > > * and then drop through to queue the callback. > > */ > > BUG_ON(cpu != -1); > > + WARN_ON_ONCE(!rcu_is_watching()); > > if (!likely(rdp->nxtlist)) > > init_default_callback_list(rdp); > > } > > diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h > > index 75d5f096bcb0..afddd5641bea 100644 > > --- a/kernel/rcu/tree_plugin.h > > +++ b/kernel/rcu/tree_plugin.h > > @@ -2393,18 +2393,8 @@ void __init rcu_init_nohz(void) > > pr_info("\tPoll for callbacks from no-CBs CPUs.\n"); > > > > for_each_rcu_flavor(rsp) { > > - for_each_cpu(cpu, rcu_nocb_mask) { > > - struct rcu_data *rdp = per_cpu_ptr(rsp->rda, cpu); > > - > > - /* > > - * If there are early callbacks, they will need > > - * to be moved to the nocb lists. > > - */ > > - WARN_ON_ONCE(rdp->nxttail[RCU_NEXT_TAIL] != > > - &rdp->nxtlist && > > - rdp->nxttail[RCU_NEXT_TAIL] != NULL); > > - init_nocb_callback_list(rdp); > > - } > > + for_each_cpu(cpu, rcu_nocb_mask) > > + init_nocb_callback_list(per_cpu_ptr(rsp->rda, cpu)); > > rcu_organize_nocb_kthreads(rsp); > > } > > } > > @@ -2541,6 +2531,16 @@ static bool init_nocb_callback_list(struct rcu_data > > *rdp) > > if (!rcu_is_nocb_cpu(rdp->cpu)) > > return false; > > > > + /* If there are early-boot callbacks, move them to nocb lists. */ > > + if (rdp->nxtlist) { > > + rdp->nocb_head = rdp->nxtlist; > > + rdp->nocb_tail = rdp->nxttail[RCU_NEXT_TAIL]; > > + atomic_long_set(&rdp->nocb_q_count, rdp->qlen); > > + atomic_long_set(&rdp->nocb_q_count_lazy, rdp->qlen_lazy); > > + rdp->nxtlist = NULL; > > + rdp->qlen = 0; > > + rdp->qlen_lazy = 0; > > + } > > rdp->nxttail[RCU_NEXT_TAIL] = NULL; > > return true; > > } > > -- > > 1.8.1.5 > > > > > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com >