Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Sep 2003 21:16:13 -0500
From:      "Alan L. Cox" <alc@imimic.com>
To:        Jeff Roberson <jroberson@chesapeake.net>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/vm vm_pageout.c
Message-ID:  <3F69156D.EDC5C36D@imimic.com>
References:  <20030917143058.X55626-100000@mail.chesapeake.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Jeff Roberson wrote:
> 
> On Tue, 16 Sep 2003, Alan Cox wrote:
> 
> > alc         2003/09/16 23:55:42 PDT
> >
> >   FreeBSD src repository
> >
> >   Modified files:
> >     sys/vm               vm_pageout.c
> >   Log:
> >   When calling vget() on a vnode-backed vm object, acquire the vnode
> >   interlock before releasing the vm object's lock.
> >
> >   Revision  Changes    Path
> >   1.243     +3 -2      src/sys/vm/vm_pageout.c
> >
> 
> Very interesting, can you describe the relationship between the vm object
> lock and the interlock?  Why was a reference to the vnode not enough?
> 

I'm trying to make sure that nothing "bad" happens to the vnode between
the time that the vm object lock is released and vget() increments the
vnode's use count.  There would otherwise be a window between the
release of the vm object lock and the acquire of the interlock in
vget().

Consider vm_object_reference(), for example.  If I didn't acquire the
interlock before releasing the vm object lock, it's possible that a
vm_object_deallocate() could jump in, leaving the vm object's reference
count non-zero but causing the vnode's use count to prematurely reach
zero.

Regards,
Alan



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