Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Aug 2007 08:50:41 -0700
From:      Alfred Perlstein <alfred@freebsd.org>
To:        Pawel Jakub Dawidek <pjd@FreeBSD.org>
Cc:        freebsd-arch@FreeBSD.org
Subject:   Re: Lockless uidinfo.
Message-ID:  <20070818155041.GY90381@elvis.mu.org>
In-Reply-To: <20070818150028.GD6498@garage.freebsd.pl>
References:  <20070818120056.GA6498@garage.freebsd.pl> <20070818142337.GW90381@elvis.mu.org> <20070818150028.GD6498@garage.freebsd.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
* Pawel Jakub Dawidek <pjd@FreeBSD.org> [070818 07:59] wrote:
> On Sat, Aug 18, 2007 at 07:23:37AM -0700, Alfred Perlstein wrote:
> > * Pawel Jakub Dawidek <pjd@FreeBSD.org> [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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070818155041.GY90381>