I need to segregate the stores executed by the CPU doing the membar.
All other CPUs must observe the preceding stores before the following
stores. Of course, this means that the loads on the observing CPUs
must be ordered somehow. I need data dependencies between the loads
to be sufficient to order the loads.
For example, if a CPU executes the following:
a = new_value;
wmbdd();
p = &a;
then i need any other CPU executing:
d = *p;
to see either the value that "p" pointed to before the "p = &a" assignment,
or "new_value", -never- the old value of "a".
Does this do the trick?
membar #StoreStore
> Thoughts?
>
> I think if you need to perform IPIs and junk like that to make the
> memory barrier happen correctly, just throw your code away and use a
> spinlock instead.
The IPIs and related junk are I believe needed only on Alpha, which has
no single memory-barrier instruction that can do wmbdd()'s job. Given
that Alpha seems to be on its way out, this did not seem to me to be
too horrible.
Thanx, Paul
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/