Re: [PATCH RFC tip/core/rcu] v2 accelerate grace period if lastnon-dynticked CPU

From: Frederic Weisbecker
Date: Wed Feb 03 2010 - 19:53:42 EST


On Sun, Jan 31, 2010 at 08:24:04PM -0800, Paul E. McKenney wrote:
> There is nothing illegal about the following:
>
> static void my_rcu_callback(struct rcu_head *rcu)
> {
> struct foo *fp = container_of(rcu, struct foo, rcu_head);
>
> if (fp->refcnt != 0) {
> call_rcu(rcu);
> return;
> }
> kfree(fp);
> }
>
> And allowing RCU_NEEDS_CPU_FLUSHES of infinity would work correctly in
> some sense, but would be a massive power inefficiency.
>
> The choice of "5" allows a callback that posts one other callback,
> which happens often enough to be worth the extra iterations. It is
> necessary to budget two passes through the loop per level of RCU
> callback, one for the current CPU to start the grace period and another
> for it to end it.
>
> Seem reasonable?


Yeah ok, I did not considered situations like the above example.

Thanks.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/