Re: [PATCH 2/5] rcu: don't check ->donelist in __rcu_pending()

From: Paul E. McKenney
Date: Mon Jan 09 2006 - 13:58:16 EST


On Sun, Jan 08, 2006 at 10:19:24PM +0300, Oleg Nesterov wrote:
> ->donelist becomes != NULL only in rcu_process_callbacks().
>
> rcu_process_callbacks() always calls rcu_do_batch() when
> ->donelist != NULL.
>
> rcu_do_batch() schedules rcu_process_callbacks() again if
> ->donelist was not flushed entirely.
>
> So ->donelist != NULL means that rcu_tasklet is either
> TASKLET_STATE_SCHED or TASKLET_STATE_RUN, we don't need to
> check it in __rcu_pending().

As Vatsa noted, this is needed if the CPU-hotplug case moves
from ->donelist to ->donelist. It could be omitted if CPU-hotplug
instead moves from ->donelist to ->nextlist, as is the case in Oleg's
patch. The extra grace-period delay should not be a problem for the
presumably rare hotplug case, but:

o the extra test in __rcu_pending() should be quite inexpensive,
since the cacheline is already loaded given the earlier tests.

o although tasklet_schedule() looks to be perfectly reliable
right now, and although any bugs in tasklet_schedule() must
be fixed, having RCU leakage be the major symptom of
tasklet_schedule() failure sounds quite unfriendly to me.

So I am not (yet) convinced that this patch is the way to go.

Thanx, Paul

> [ This patch was tested with rcutorture.ko, I don't understand
> it's output, but it says "End of test: SUCCESS". So if this
> patch incorrect blame Paul, not me! ]
>
> Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
>
> --- 2.6.15/kernel/rcupdate.c~2_DONE 2006-01-08 21:35:21.000000000 +0300
> +++ 2.6.15/kernel/rcupdate.c 2006-01-08 21:55:45.000000000 +0300
> @@ -454,10 +454,6 @@ static int __rcu_pending(struct rcu_ctrl
> if (!rdp->curlist && rdp->nxtlist)
> return 1;
>
> - /* This cpu has finished callbacks to invoke */
> - if (rdp->donelist)
> - return 1;
> -
> /* The rcu core waits for a quiescent state from the cpu */
> if (rdp->quiescbatch != rcp->cur || rdp->qs_pending)
> return 1;
>
-
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/