[lkml]   [1999]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: spin_unlock optimization(i386)

> >The only thing you need is to make sure there is a store in "spin_unlock()",
> So we could reimplement a rmb() (and in turn an mb()) that scales in SMP?
> Something like:
> #define rmb() ... "movb $0, ZERO_PAGE+32*smp_processor_id()"
> This because the spin_unlock really is:
> mb();
> spin_lock.lock = 0;
> If spin_unlock() doesn't need the lock, mb() doesn't need the lock
> on the bus either.

No. Any aligned store (which you get from the compiler) will be atomic
even in an SMP system.

> Am I missing something?

I don't think so.

What do you want the memory barrier for other than to prevent reads
from crossing the unlock? (apologies if I missed this in an earlier

Erich Boleyn
PMD IA32 Architecture

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:55    [W:0.081 / U:5.560 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site