Messages in this thread |  | | Date | Thu, 3 Nov 2011 12:53:00 -0700 | | From | "Paul E. McKenney" <> | | 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
|  |