Re: Lockless uidinfo.



* Pawel Jakub Dawidek <pjd@xxxxxxxxxxx> [070818 07:59] wrote:
On Sat, Aug 18, 2007 at 07:23:37AM -0700, Alfred Perlstein wrote:
* Pawel Jakub Dawidek <pjd@xxxxxxxxxxx> [070818 05:31] wrote:
Hi.

The patch below remove per-uidinfo locks:

http://people.freebsd.org/~pjd/patches/uidinfo_lockless.patch

In uifree() is it ok to manually check the refcount for 0?

I'm gussing the hashmtx is used as a barrier?

Yes, to lookup uidinfo you need to hold uihashtbl_mtx mutex, so once you
hold it and ui_ref is 0, noone will be able to reference it, because it
has to wait to look it up.

And the field doesn't need to be volatile to prevent cached/opportunitic
reads?


--
- Alfred Perlstein
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Lockless uidinfo.
    ... In uifree() is it ok to manually check the refcount for 0? ... I'm gussing the hashmtx is used as a barrier? ...
    (freebsd-arch)
  • Re: Lockless uidinfo.
    ... In uifree() is it ok to manually check the refcount for 0? ... I'm gussing the hashmtx is used as a barrier? ...
    (freebsd-arch)