From owner-cvs-src@FreeBSD.ORG Fri Nov 5 22:21:37 2004 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 B4AA716A520; Fri, 5 Nov 2004 22:21:37 +0000 (GMT) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6648543D1D; Fri, 5 Nov 2004 22:21:37 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.13.1/8.12.10) with ESMTP id iA5MLJuI007212; Fri, 5 Nov 2004 17:21:20 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.13.1/8.12.10/Submit) id iA5MLJo3007211; Fri, 5 Nov 2004 17:21:19 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Fri, 5 Nov 2004 17:21:19 -0500 From: David Schultz To: Andrey Chernov , src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG Message-ID: <20041105222119.GB6935@VARK.MIT.EDU> Mail-Followup-To: Andrey Chernov , src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG References: <200411050536.iA55auAU069109@repoman.freebsd.org> <20041105072505.GA87598@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041105072505.GA87598@nagual.pp.ru> Subject: Re: cvs commit: src/sys/vm swap_pager.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: Fri, 05 Nov 2004 22:21:37 -0000 On Fri, Nov 05, 2004, Andrey Chernov wrote: > On Fri, Nov 05, 2004 at 05:36:56AM +0000, David Schultz wrote: > > das 2004-11-05 05:36:56 UTC > > > > FreeBSD src repository > > > > Modified files: > > sys/vm swap_pager.c > > Log: > > Close a race in swapoff(). Here are the gory details: > > > > Is this commit supposed to fix lost blocks race using swapoff in > /etc/rc.d/swap1 ? Probably not. I believe the race that's causing this problem is related to putpages(). The swapoff() code assumes that any thread that has allocated swap blocks has initialized at least one of the swblock structures to point to the object that's paging. However, putpages() may be sleeping in getpbuf() while it's claiming a bunch of blocks that aren't in the swblock hash table yet. With a little bit of rearranging, I could probably fix the problem in putpages(), or I could make swapoff() retry until it gets everything. I think md devices with -oreserve could be a problem as well.