Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Nov 2004 17:21:19 -0500
From:      David Schultz <das@FreeBSD.ORG>
To:        Andrey Chernov <ache@nagual.pp.ru>, src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/vm swap_pager.c
Message-ID:  <20041105222119.GB6935@VARK.MIT.EDU>
In-Reply-To: <20041105072505.GA87598@nagual.pp.ru>
References:  <200411050536.iA55auAU069109@repoman.freebsd.org> <20041105072505.GA87598@nagual.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



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