tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: UVM/genfs review



On Thu, Jan 15, 2009 at 09:58:32AM +0100, Juergen Hannken-Illjes wrote:
> Just tried to look again at this deadlock.  All I have is part of the ddb
> log (attached).  It happened on my build-once-a-day machine once in ~ 4 weeks,
> so it is not easy to repeat.  I never saw it again after the commit Joerg
> wants to revert.

This is from memory as I can't find my notes about the issues I saw.
Central problem is the UVM_UNLOCK_AND_WAIT(pg, slock, 0, "genput", 0)
call in genfs_do_putpages. After the 1.12 commit, this is done with the
journal locked and the results are obviously extremly bad. 

One possible workaround for this is the attached patch and force the
journal to be locked for full_fsync as well.

Joerg
Index: ffs_vnops.c
===================================================================
RCS file: /home/joerg/repo/netbsd/src/sys/ufs/ffs/ffs_vnops.c,v
retrieving revision 1.108
diff -u -p -r1.108 ffs_vnops.c
--- ffs_vnops.c 28 Dec 2008 16:27:00 -0000      1.108
+++ ffs_vnops.c 15 Jan 2009 10:21:57 -0000
@@ -435,14 +435,18 @@ ffs_full_fsync(struct vnode *vp, int fla
         */
 
        if (vp->v_type == VREG || vp->v_type == VBLK) {
-               int pflags = PGO_ALLPAGES | PGO_CLEANIT;
+               int pflags = PGO_ALLPAGES | PGO_CLEANIT | PGO_JOURNALLOCKED;
 
                if ((flags & FSYNC_WAIT))
                        pflags |= PGO_SYNCIO;
                if (vp->v_type == VREG &&
                    fstrans_getstate(mp) == FSTRANS_SUSPENDING)
                        pflags |= PGO_FREE;
+               error = UFS_WAPBL_BEGIN(mp);
+               if (error)
+                       return error;
                error = VOP_PUTPAGES(vp, 0, 0, pflags);
+               UFS_WAPBL_END(mp);
                if (error)
                        return error;
        } else {


Home | Main Index | Thread Index | Old Index