Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753605AbbGANmd (ORCPT ); Wed, 1 Jul 2015 09:42:33 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:36268 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754194AbbGANmY (ORCPT ); Wed, 1 Jul 2015 09:42:24 -0400 X-Helo: d03dlp03.boulder.ibm.com X-MailFrom: paulmck@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org Date: Wed, 1 Jul 2015 06:42:15 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, dvhart@linux.intel.com, fweisbec@gmail.com, oleg@redhat.com, bobby.prani@gmail.com Subject: Re: [PATCH RFC tip/core/rcu 2/5] rcu: Short-circuit normal GPs via expedited GPs Message-ID: <20150701134215.GZ3717@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20150630214805.GA7795@linux.vnet.ibm.com> <1435700910-9104-1-git-send-email-paulmck@linux.vnet.ibm.com> <1435700910-9104-2-git-send-email-paulmck@linux.vnet.ibm.com> <20150701100352.GO19282@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150701100352.GO19282@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15070113-0025-0000-0000-0000104A208B Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1638 Lines: 53 On Wed, Jul 01, 2015 at 12:03:52PM +0200, Peter Zijlstra wrote: > On Tue, Jun 30, 2015 at 02:48:27PM -0700, Paul E. McKenney wrote: > > @@ -2121,17 +2137,24 @@ static int __noreturn rcu_gp_kthread(void *arg) > > TPS("fqswait")); > > rsp->gp_state = RCU_GP_WAIT_FQS; > > ret = wait_event_interruptible_timeout(rsp->gp_wq, > > - ((gf = READ_ONCE(rsp->gp_flags)) & > > - RCU_GP_FLAG_FQS) || > > - (!READ_ONCE(rnp->qsmask) && > > - !rcu_preempt_blocked_readers_cgp(rnp)), > > - j); > > + ((gf = READ_ONCE(rsp->gp_flags)) & > > + RCU_GP_FLAG_FQS) || > > + (!READ_ONCE(rnp->qsmask) && > > + !rcu_preempt_blocked_readers_cgp(rnp)) || > > + rcu_exp_gp_seq_done(rsp->exp_rsp, > > + rsp->gp_exp_snap), > > + j); > > How about using a helper function there? Good point, will do. Thanx, Paul > static inline bool rcu_gp_done(rsp, rnp) > { > /* Forced Quiescent State complete */ > if (READ_ONCE(rsp->gp_flags) & RCU_GP_FLAG_FQS) > return true; > > /* QS not masked and not blocked by preempted readers */ > if (!READ_ONCE(rnp->qsmask) && > !rcu_preempt_blocked_readers_cgp(rnp)) > return true; > > /* Expedited Grace Period completed */ > if (rcu_exp_gp_seq_done(rsp)) > return true; > > return false; > } > > ret = wait_event_interruptible_timeout(rsp->gp_wq, > rcu_gp_done(rsp, rnp), j); > > -- 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/