Re: Re: [PATCH] PPC lll_mutex_unlock_force write barrier

"Alexander Terekhov" <[email protected]>
Newsgroups gmane.comp.lib.phil
Organization http://freemail.web.de/
Message-ID <[email protected]>
Steve Munroe <[email protected]> schrieb am 28.08.03 00:01:46:
> 
> Alexander Terekhov writes:
> 
> > Sort of. First off, unless I'm just missing and/or misunderstanding
> > something, you've put it in the wrong place. Also, a write barrier 
> > isn't enough here. mutex.unlock also needs a read barrier.
> 
> Actually I was refering to lll_mutex_unlock_force which stuffs a 0 into 
> the lock word then calls lll_futex_wake. This is different from 
> lll_mutex_unlock, which uses atomic_exchange_rel,  which includes all the 
> required synchronization.

You'll need an equivalent of Itanic's "st.rel" to stuff a 0 into the 
lock word. In SPARC-RMO "speach", that would be

   membar #StoreStore 
   membar #LoadStore  
   st %g0,[lock] 

not

   st %g0,[lock] 
   membar #StoreStore 
   membar #LoadStore  
   ...

For PPC, you'll need to place the msync barrier (with the semantics 
as close as possible to "sink-store + sink-load" -- aka "release") 
BEFORE stuffing 0 into a lock word. Oder?

regards,
alexander.

__________________________________________________________________________
Die sicherste Form der Kommunikation: E-Mails verschluesseln, Spam-Filter,
Adressverifizierung, digitale Unterschrift: http://freemail.web.de
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.