From owner-cvs-src@FreeBSD.ORG Wed Sep 17 19:16:25 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B0AE216A4BF for ; Wed, 17 Sep 2003 19:16:25 -0700 (PDT) Received: from mail26d.sbc-webhosting.com (mail26d.sbc-webhosting.com [216.173.237.167]) by mx1.FreeBSD.org (Postfix) with SMTP id E207743FDD for ; Wed, 17 Sep 2003 19:16:22 -0700 (PDT) (envelope-from alc@imimic.com) Received: from www.imimic.com (64.143.12.21)1-0994491371; Wed, 17 Sep 2003 22:16:12 -0400 (EDT) Sender: alc@FreeBSD.ORG Message-ID: <3F69156D.EDC5C36D@imimic.com> Date: Wed, 17 Sep 2003 21:16:13 -0500 From: "Alan L. Cox" Organization: iMimic Networking, Inc. X-Mailer: Mozilla 4.8 [en] (X11; U; Linux 2.4.2 i686) X-Accept-Language: en MIME-Version: 1.0 To: Jeff Roberson References: <20030917143058.X55626-100000@mail.chesapeake.net> Content-Type: text/plain; charset=x-user-defined Content-Transfer-Encoding: 7bit X-Loop-Detect: 1 cc: Alan Cox cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/vm vm_pageout.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2003 02:16:25 -0000 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