Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Dec 1996 17:49:23 -0800
From:      Thomas Pfenning <thomaspf@microsoft.com>
To:        "'Steve Passe'" <smp@csn.net>
Cc:        "'Chris Csanady'" <ccsanady@friley216.res.iastate.edu>, "'Peter Wemm'" <peter@spinner.dialix.com>, "'smp@freebsd.org'" <smp@freebsd.org>
Subject:   RE: make locking more generic? 
Message-ID:  <c=US%a=_%p=msft%l=RED-81-MSG-961206014923Z-7148@INET-01-IMC.microsoft.com>

next in thread | raw e-mail | index | archive | help
Actually you can do something about it which does not cause any
contention on the bus doing the update protocol and even grants the lock
in fifo order. However, the lock actually transforms into a linked list
and you spin on memory location in your local cache, so you want to make
it aligned to cache lines.

Mellor-Crummey and M. Scott, Algorithms for scalable synchronization on
shared-memory multiprocessors; ACM Trans. Computer Systems, 9(1):21--65
(1991)

Cheers

	Thomas

>-----Original Message-----
>From:	Steve Passe [SMTP:smp@csn.net]
>Sent:	Thursday, December 05, 1996 5:07 PM
>To:	Thomas Pfenning
>Cc:	'Chris Csanady'; 'Peter Wemm'; 'smp@freebsd.org'
>Subject:	Re: make locking more generic? 
>
>> Hmm,
>> 
>> but xchgb actually writes a new value into the cache line on each spin
>> and dirties the cache line? So you are saying, the cache coherence
>> protocol is smart enough to recognize it is the same value and does not
>> actually require an update of the cache in a remote CPU spinning on the
>> same lock. Or is it the xchgb instruction which does not write an 0xff
>> if it is already there?
>
>oh-oh, I didn't read close enough (alot of mail has backed up lately).
>forget what I said...
>
>cache, I couldn't say, it might have a bad effect but what can you do
>about it? a blocking lock as oppossed to a spin-lock?  I think the theory is
>that the collissions are statistically so short that anything more complex
>would be a loosing situation.
>
>----
>> The other thing I don't quite understand is the use of an atomic memory
>> operation for the unlock. 
>
>the atomic move may or may not be necessary.  since its a byte there is
>no chance a misaligned lock being written in 2 bus operations.  anyone know?
>
>--
>Steve Passe	| powered by
>smp@csn.net	|            FreeBSD
>
>-----BEGIN PGP PUBLIC KEY BLOCK-----
>Version: 2.6.2
>
>mQCNAzHe7tEAAAEEAM274wAEEdP+grIrV6UtBt54FB5ufifFRA5ujzflrvlF8aoE
>04it5BsUPFi3jJLfvOQeydbegexspPXL6kUejYt2OeptHuroIVW5+y2M2naTwqtX
>WVGeBP6s2q/fPPAS+g+sNZCpVBTbuinKa/C4Q6HJ++M9AyzIq5EuvO0a8Rr9AAUR
>tBlTdGV2ZSBQYXNzZSA8c21wQGNzbi5uZXQ+
>=ds99
>-----END PGP PUBLIC KEY BLOCK-----
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c=US%a=_%p=msft%l=RED-81-MSG-961206014923Z-7148>