[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111103195300.GI2287@linux.vnet.ibm.com>
Date: Thu, 3 Nov 2011 12:53:00 -0700
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: Josh Triplett <josh@...htriplett.org>
Cc: linux-kernel@...r.kernel.org, mingo@...e.hu, laijs@...fujitsu.com,
dipankar@...ibm.com, akpm@...ux-foundation.org,
mathieu.desnoyers@...ymtl.ca, niv@...ibm.com, tglx@...utronix.de,
peterz@...radead.org, rostedt@...dmis.org, Valdis.Kletnieks@...edu,
dhowells@...hat.com, eric.dumazet@...il.com, darren@...art.com,
patches@...aro.org, "Paul E. McKenney" <paul.mckenney@...aro.org>
Subject: Re: [PATCH RFC tip/core/rcu 27/28] rcu: Allow dyntick-idle mode
for CPUs with callbacks
On Wed, Nov 02, 2011 at 09:47:44PM -0700, Josh Triplett wrote:
> On Wed, Nov 02, 2011 at 01:30:48PM -0700, Paul E. McKenney wrote:
> > /*
> > - * Check to see if any future RCU-related work will need to be done
> > - * by the current CPU, even if none need be done immediately, returning
> > - * 1 if so. This function is part of the RCU implementation; it is -not-
> > - * an exported member of the RCU API.
> > + * Allow the CPU to enter dyntick-idle mode if either: (1) There are no
> > + * callbacks on this CPU, (2) this CPU has not yet attempted to enter
> > + * dyntick-idle mode, and (3) this CPU is in the process of attempting to
> > + * enter dyntick-idle mode. Otherwise, if we have recently tried and failed
>
> This sentence doesn't quite work; "if either...and..." should become
> "either...or" or "if...and".
Good eyes -- "or" it is!
> > + * to enter dyntick-idle mode, we refuse to try to enter it. After all,
> > + * it is better to incur scheduling-clock interrupts than to spin
> > + * continuously for the same time duration!
> > + */
> > +int rcu_needs_cpu(int cpu)
> > +{
> > + /* If no callbacks, RCU doesn't need the CPU. */
> > + if (!rcu_cpu_has_callbacks(cpu))
> > + return 0;
> > + /* Otherwise, RCU needs the CPU only if it recently tried and failed. */
> > + return per_cpu(rcu_dyntick_holdoff, cpu) == jiffies;
>
> Sigh, one more use of jiffies. :(
Your suggested alternative? I need something cheap, doesn't need to
be accurate to more than a few milliseconds, needs to be synchronized
across all CPUs.
Thanx, Paul
--
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