Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Mar 2008 02:44:39 -1000 (HST)
From:      Jeff Roberson <jroberson@chesapeake.net>
To:        Konstantin Belousov <kib@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/ufs/ffs ffs_vnops.c
Message-ID:  <20080321024123.P910@desktop>
In-Reply-To: <200803211233.m2LCX1Bm099652@repoman.freebsd.org>
References:  <200803211233.m2LCX1Bm099652@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 21 Mar 2008, Konstantin Belousov wrote:

> kib         2008-03-21 12:33:00 UTC
>
>  FreeBSD src repository
>
>  Modified files:
>    sys/ufs/ffs          ffs_vnops.c
>  Log:
>  Reduce the acquisition of the vnode interlock in the ffs_read() and
>  ffs_extread() when setting the IN_ACCESS flag by checking whether the
>  IN_ACCESS is already set. The possible race there is admissible.

I don't believe there is a race because we should always hold an exclusive 
vnode lock and the vnode interlock when clearing.  The exclusive node lock 
would prevent ffs_read() from executing entirely, so we don't have to 
worry about races with clearing the bit.  Races to set the bit are handled 
by the vnode interlock.

I should also mention that while this may seem innocuous enough this 
figured heavily in LOCK_PROFILING for a real workload.

Thanks,
Jeff

>
>  Tested by:      pho
>  Submitted by:   jeff
>
>  Revision  Changes    Path
>  1.180     +4 -2      src/sys/ufs/ffs/ffs_vnops.c
>



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