Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Nov 2000 15:06:27 -0800 (PST)
From:      Matt Dillon <dillon@FreeBSD.org>
To:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/kern vfs_bio.c vfs_cluster.c vfs_subr.c vfs_vnops.c src/sys/sys buf.h vnode.h src/sys/ufs/ffs ffs_inode.c ffs_softdep.c src/sys/ufs/ufs ufs_readwrite.c src/sys/vm swap_pager.c vm_page.c vm_page.h vm_pageout.c
Message-ID:  <200011182306.PAA43446@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
dillon      2000/11/18 15:06:27 PST

  Modified files:
    sys/kern             vfs_bio.c vfs_cluster.c vfs_subr.c 
                         vfs_vnops.c 
    sys/sys              buf.h vnode.h 
    sys/ufs/ffs          ffs_inode.c ffs_softdep.c 
    sys/ufs/ufs          ufs_readwrite.c 
    sys/vm               swap_pager.c vm_page.c vm_page.h 
                         vm_pageout.c 
  Log:
  Implement a low-memory deadlock solution.
  
      Removed most of the hacks that were trying to deal with low-memory
      situations prior to now.
  
      The new code is based on the concept that I/O must be able to function in
      a low memory situation.  All major modules related to I/O (except
      networking) have been adjusted to allow allocation out of the system
      reserve memory pool.  These modules now detect a low memory situation but
      rather then block they instead continue to operate, then return resources
      to the memory pool instead of cache them or leave them wired.
  
      Code has been added to stall in a low-memory situation prior to a vnode
      being locked.
  
      Thus situations where a process blocks in a low-memory condition while
      holding a locked vnode have been reduced to near nothing.  Not only will
      I/O continue to operate, but many prior deadlock conditions simply no
      longer exist.
  
  Implement a number of VFS/BIO fixes
  
  	(found by Ian): in biodone(), bogus-page replacement code, the loop
          was not properly incrementing loop variables prior to a continue
          statement.  We do not believe this code can be hit anyway but we
          aren't taking any chances.  We'll turn the whole section into a
          panic (as it already is in brelse()) after the release is rolled.
  
  	In biodone(), the foff calculation was incorrectly
          clamped to the iosize, causing the wrong foff to be calculated
          for pages in the case of an I/O error or biodone() called without
          initiating I/O.  The problem always caused a panic before.  Now it
          doesn't.  The problem is mainly an issue with NFS.
  
  	Fixed casts for ~PAGE_MASK.  This code worked properly before only
          because the calculations use signed arithmatic.  Better to properly
          extend PAGE_MASK first before inverting it for the 64 bit masking
          op.
  
  	In brelse(), the bogus_page fixup code was improperly throwing
          away the original contents of 'm' when it did the j-loop to
          fix the bogus pages.  The result was that it would potentially
          invalidate parts of the *WRONG* page(!), leading to corruption.
  
  	There may still be cases where a background bitmap write is
          being duplicated, causing potential corruption.  We have identified
          a potentially serious bug related to this but the fix is still TBD.
          So instead this patch contains a KASSERT to detect the problem
    	and panic the machine rather then continue to corrupt the filesystem.
  	The problem does not occur very often..  it is very hard to
  	reproduce, and it may or may not be the cause of the corruption
  	people have reported.
  
  Review by: (VFS/BIO: mckusick, Ian Dowse <iedowse@maths.tcd.ie>)
  Testing by: (VM/Deadlock) Paul Saab <ps@yahoo-inc.com>
  
  Revision  Changes    Path
  1.267     +129 -81   src/sys/kern/vfs_bio.c
  1.101     +7 -1      src/sys/kern/vfs_cluster.c
  1.291     +11 -5     src/sys/kern/vfs_subr.c
  1.106     +4 -2      src/sys/kern/vfs_vnops.c
  1.112     +2 -1      src/sys/sys/buf.h
  1.133     +2 -1      src/sys/sys/vnode.h
  1.65      +4 -1      src/sys/ufs/ffs/ffs_inode.c
  1.76      +20 -18    src/sys/ufs/ffs/ffs_softdep.c
  1.70      +5 -1      src/sys/ufs/ufs/ufs_readwrite.c
  1.147     +4 -2      src/sys/vm/swap_pager.c
  1.154     +30 -7     src/sys/vm/vm_page.c
  1.83      +3 -1      src/sys/vm/vm_page.h
  1.162     +97 -73    src/sys/vm/vm_pageout.c



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?200011182306.PAA43446>