cvs commit: src/sys/vm swap_pager.c

David Schultz das at FreeBSD.ORG
Fri Nov 5 22:21:37 GMT 2004


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.


More information about the cvs-src mailing list