Re: [PATCH] rcu: eliminate rcu_data.last_qsctr

From: Manfred Spraul
Date: Wed Dec 29 2004 - 10:41:29 EST


Oleg Nesterov wrote:

last_qsctr is used in rcu_check_quiescent_state() exclusively.
We can reset qsctr at the start of the grace period, and then
just test qsctr against 0.



It seems the patch got lost, I've updated it a bit and resent it to Andrew.

But: I think there is the potential for an even larger cleanup, although this would be more a rewrite:
Get rid of rcu_check_quiescent_state and instead use something like this in rcu_qsctr_inc:

static inline void rcu_qsctr_inc(int cpu)
{
struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
if (rdp->quiescbatch != rcp->cur) {
/* a new grace period is running. And we are at a quiescent
* point, so complete it
*/
spin_lock(&rsp->lock);
rdp->quiescbatch = rcp->cur;
cpu_quiet(rdp->cpu, rcp, rsp);
spin_unlock(&rsp->lock);
}
}

It's just an idea, it needs testing on big systems - does reading from the global rcp from every schedule call cause any problems? The cache line is virtually read-only, so it shouldn't cause trashing, but who knows?

--
Manfred
-
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/