Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 May 2010 19:28:06 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Matthew Fleming <matthew.fleming@isilon.com>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, Zachary Loafman <zml@freebsd.org>, src-committers@freebsd.org
Subject:   Re: svn commit: r208003 - in head/sys: kern sys
Message-ID:  <20100517162806.GM83316@deviant.kiev.zoral.com.ua>
In-Reply-To: <06D5F9F6F655AD4C92E28B662F7F853E021D4D66@seaxch09.desktop.isilon.com>
References:  <201005122124.o4CLOk3b027904@svn.freebsd.org> <20100516050651.GZ83316@deviant.kiev.zoral.com.ua> <06D5F9F6F655AD4C92E28B662F7F853E021D4D66@seaxch09.desktop.isilon.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--n8d7KAgWmJ23Ts4y
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, May 17, 2010 at 08:33:52AM -0700, Matthew Fleming wrote:
> > From: Kostik Belousov [mailto:kostikbel@gmail.com]
> > On Wed, May 12, 2010 at 09:24:46PM +0000, Zachary Loafman wrote:
> > > Author: zml
> > > Date: Wed May 12 21:24:46 2010
> > > New Revision: 208003
> > > URL: http://svn.freebsd.org/changeset/base/208003
> > >=20
> > > Log:
> > >   Add VOP_ADVLOCKPURGE so that the file system is called when purging
> > >   locks (in the case where the VFS impl isn't using lf_*)
> > >  =20
> > >   Submitted by:       Matthew Fleming <matthew.fleming@isilon.com>
> > >   Reviewed by:        zml, dfr
> >=20
> > After looking at what happen to nullfs, see r208003, I wonder why
> > the vop is needed. It is called after VOP_RECLAIM is called by vgonel(),
> > after fs-specific data are destroyed. So, on the one hand, vop can only
> > operate on struct vnode proper, on the other hand, the actions performed
> > by vop_advlockpurge implementation can be done by vop_reclaim as well.
> >=20
> > Could you, please, give some details on the supposed use of the vop ?
>=20
> >From a design perspective, it makes little sense to allow overriding
> the advlock operation, but not the purge. A specific example is if an
> implementation does not use struct lockf to implement advlock, then
> the hack you mention of purging in VOP_RECLAIM is needed.
>
> After looking over the history of the changes, I believe it would be
> sufficient to have the lock purge done before the reclaim. The vnode
> is locked exclusively for both operations, so I don't believe there
> will be any timing windows. But I am still not 100% sure when the file
> lock is used versus the interlock for serializing access to various
> fields.
>
> The advlock VOPs are analogous to the regular VOP_LOCK in that we
> expect an implementation may override the VOP and also the data
> structures used, e.g. to not use the vnode's v_lock field for the
> VOP_LOCK. Thus any code which refers to v_lockf should be wrapped in a
> VOP to allow correct overriding.

Essentially, my argument is that whatever you do in VOP_ADVLOCKPURGE,
can be and should be done in VOP_RECLAIM. This would also cover the v_data
issue.

--n8d7KAgWmJ23Ts4y
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkvxbpUACgkQC3+MBN1Mb4jcwQCeItE83uff8FnY+WbI7H0xwDC+
QQAAoMFTDaTO9L/6gYGutbLyqpOoIJZd
=PJi1
-----END PGP SIGNATURE-----

--n8d7KAgWmJ23Ts4y--



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