Subject: Re: lock-free data structures
To: None <jonathan@dsg.stanford.edu>
From: None <zvrba@globalnet.hr>
List: tech-kern
Date: 01/04/2006 19:26:05
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

On Wed, Jan 04, 2006 at 09:38:20AM -0800, jonathan@dsg.stanford.edu wrote:
> 
> For practical kernel use, one will soon find one *needs* a DCAS/CAS2,
> or some suitable approximation. 
> 
Newer 32-bit Intel processors offer the 8-byte cmpxchg, and the 64-bit
AMDs offer the 16-byte cmpxchg. Would these be sufficient? [In one of
the papers I remember seeing that DCAS si defined to take two distinct
memory locations but which are not neccessarily adjacent, unlike the
working of CMPXCHG8B]

> 
> Oh, one more thing: to suggest using ras(9) is proof-positive that the
> suggester simply doesn't understand the problem domain.  Bershad's
>
Hm, I admit that I don't understand the NetBSD kernel part. I have never
even read the manpage thoroughly. What I read in the paper reminded me
on ras(9) on which I have browsed through the manpage some time ago.. I
assumed that it was intended for in-kernel use since it is in the 9th
section of the manual.. :) It turns out that it is (I guess) just the
kernel support for rasctl(2)?

Bottom line: disregarding portability, would it be beneficial to use
waitfree data structures in the kernel instead of explicit locks (on
architectures that properly and efficiently support DCAS)? Or most of
such structures are logically tied to some other resource so locks are
needed anyway (as someone has already pointed out)?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDvBM9FtofFpCIfhMRA7JMAJ0dkNE5cjm7aBIl9dGoznOwyfAnEQCggY1I
KLqFbmiorRAB688W2d9oHM0=
=dVAf
-----END PGP SIGNATURE-----