lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150701134215.GZ3717@linux.vnet.ibm.com>
Date:	Wed, 1 Jul 2015 06:42:15 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	linux-kernel@...r.kernel.org, mingo@...nel.org,
	laijs@...fujitsu.com, dipankar@...ibm.com,
	akpm@...ux-foundation.org, mathieu.desnoyers@...icios.com,
	josh@...htriplett.org, tglx@...utronix.de, rostedt@...dmis.org,
	dhowells@...hat.com, edumazet@...gle.com, dvhart@...ux.intel.com,
	fweisbec@...il.com, oleg@...hat.com, bobby.prani@...il.com
Subject: Re: [PATCH RFC tip/core/rcu 2/5] rcu: Short-circuit normal GPs via
 expedited GPs

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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ