Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Oct 1998 20:33:52 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, dillon@apollo.backplane.com
Subject:   Re: Anyone got any ideas?  getblk/pgtblk/inode lockup
Message-ID:  <199810191033.UAA11898@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>    The code in question is this:
>
>	   } else if (m->flags & PG_BUSY) {
>		    s = splvm();
>		    if (m->flags & PG_BUSY) {
>			    vm_page_flag_set(m, PG_WANTED);
>			    tsleep(m, PVM, "pgtblk", 0);
>		    }
>		    splx(s);
>		    goto doretry;
>	    } ...
>
>    Looking at the kernel dump, the page structure 'm' in the process locked 
>    up in pgtblk has PG_WANTED and PG_TABLED set, but PG_BUSY cleared.
>
>    This combined with the code fragment above leads me to believe that 
>    PG_BUSY is somehow being cleared on the page without waking up the
>    process.

PG_BUSY is cleared without a wakeup in vfs_bio.c and vm_kern.c.  The wakeup
is apparently important in vfs_bio.c.  Untested fix + cosmetic fix for not
always using the specialized inline function for doing the wakeup:

diff -c2 kern/vfs_bio.c~ kern/vfs_bio.c
*** kern/vfs_bio.c~	Wed Oct 14 03:22:21 1998
--- kern/vfs_bio.c	Mon Oct 19 20:16:59 1998
***************
*** 1790,1794 ****
  
  						vm_page_wire(m);
! 						vm_page_flag_clear(m, PG_BUSY);
  						bp->b_flags &= ~B_CACHE;
  
--- 1831,1835 ----
  
  						vm_page_wire(m);
! 						vm_page_wakeup(m);
  						bp->b_flags &= ~B_CACHE;
  
diff -c2 vm/vm_page.c~ vm/vm_page.c
*** vm/vm_page.c~	Sat Sep  5 17:27:51 1998
--- vm/vm_page.c	Mon Oct 19 20:18:00 1998
***************
*** 447,455 ****
  #endif
  	
! 	vm_page_flag_clear(m, PG_BUSY);
! 	if (m->flags & PG_WANTED) {
! 		vm_page_flag_clear(m, PG_WANTED);
! 		wakeup(m);
! 	}
  
  	object = m->object;
--- 458,462 ----
  #endif
  	
! 	vm_page_wakeup(m);
  
  	object = m->object;

Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message



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