Subject: Re: File system suspension -- new API
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de>
List: tech-kern
Date: 12/31/2006 10:48:28
On Sun, Dec 31, 2006 at 04:03:49AM +0900, YAMAMOTO Takashi wrote:
> > @@ -362,9 +369,11 @@ ffs_full_fsync(void *v)
> >  
> >  	if (vp->v_type == VREG || vp->v_type == VBLK) {
> >  		simple_lock(&vp->v_interlock);
> >  		error = VOP_PUTPAGES(vp, 0, 0, PGO_ALLPAGES | PGO_CLEANIT |
> > -		    ((ap->a_flags & FSYNC_WAIT) ? PGO_SYNCIO : 0));
> > +		    ((ap->a_flags & FSYNC_WAIT) ? PGO_SYNCIO : 0) |
> > +		    (fstrans_getstate(vp->v_mount) == fstrans_suspending ?
> > +			PGO_FREE : 0));
> >  		if (error) {
> >  			return error;
> >  		}
> >  	}
> 
> why PGO_FREE?

Take this (observed) situation:

 - All inactive pages are backed by vnodes on a suspended file system.
 - The thread that took the suspension needs memory.
 - Pagedaemon tries and tries ...
 - Deadlock

Freeing the pages while preparing the suspension prevents it.

-- 
Juergen Hannken-Illjes - hannken@eis.cs.tu-bs.de - TU Braunschweig (Germany)