On Tue, 24 Aug 1999, David S. Miller wrote:
> From: Ingo Molnar <[EMAIL PROTECTED]>
>
> instead of:
>
> current->state = TASK_INTERRUPTIBLE;
> + mb();
>
> shouldnt we do:
>
> + xchgl(¤t->state, TASK_INTERRUPTIBLE);
>
> This 'merges' the barrier and the write. Or rather, in asm-i386 we could
> do something like:
>
> #define set_mb(addr,val) xchgl(addr,val)
>
> and then use set_barrier().
>
>Sure, but it costs ~8 instructions instead of 2 on ll/sc architectures.
I don't know what is "ll/sc" but I agree that at least on architectures
that has a proper "mb" assembler instruction the mb() approch seems to be
right choice to me.
When we'll reach an agreement I'll be happy to redo the patch with a
different approch. ;) (after all the conversion will be only a trivial
task)
My proposal could be something like:
set_current_state(INTERRUPTIBLE);
and #define a secondary:
__set_current_state(INTERRUPTIBLE);
that it will never used by me, but it can be used to implement future code
that doesn't need an explicit SMP memory barrier.
Hints are welcome. ;)
Thanks.
Andrea
-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]