Re: [patch 2/3] scheduler: add full memory barriers upon task switchat runqueue lock/unlock

From: Linus Torvalds
Date: Mon Feb 01 2010 - 11:58:20 EST




On Mon, 1 Feb 2010, Mathieu Desnoyers wrote:
>
> What we have to be careful about here is that it's not enough to just
> rely on switch_mm() containing a memory barrier. What we really need to
> enforce is that switch_mm() issues memory barriers both _before_ and
> _after_ mm_cpumask modification. The "after" part is usually dealt with
> by the TLB context switch, but the "before" part usually isn't.

Ok, whatever. I vote for not doing anything at all, because this just all
sounds like some totally crazy crap. You haven't explained the actual
races, you haven't explained anything at all, you're apparently just
randomly sprinkling smp_mb's around until you think it's all fine.

Show the actual memory ordering constraints as it is related to the kernel
data structures. I'm totally uninterested in general handwaving and "we
must have smp_mb's here and here" without very explicit explanations of
exactly WHAT the memory orderings are.

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