Re: [RFC PATCH] introduce sys_membarrier(): process-wide memorybarrier

From: Steven Rostedt
Date: Thu Jan 07 2010 - 12:00:18 EST


On Thu, 2010-01-07 at 08:49 -0800, Paul E. McKenney wrote:

> > If the task->rq changes, or the task->rq->curr changes, and makes the
> > condition fail (or even pass), the events that cause those changes are
> > probably good enough than needing to call smp_mb();
>
> This narrows the fatal window, but does not eliminate it. :-(
>
> The CPU doing the sys_membarrier() might see an old value of ->curr,
> and the other CPU might see an old value of whatever pointer we are
> trying to recycle. This combination is fatal.

But for curr to change, the rq spin lock must have been held. Which
implies smp_wb(). I would think that if you do a smp_rb() wouldn't that
guarantee that you see the new value of curr?

-- Steve


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