Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jun 1997 01:30:41 -0700 (PDT)
From:      Bruce Evans <bde@FreeBSD.ORG>
To:        cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-sys@FreeBSD.ORG
Subject:   cvs commit: src/sys/kern vfs_bio.c
Message-ID:  <199706130830.BAA17252@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
bde         1997/06/13 01:30:41 PDT

  Modified files:
    sys/kern             vfs_bio.c 
  Log:
  Fixed livelock in getnewbuf().
  
  It is possible for multiple process to sleep concurrently waiting
  for a buffer.  When the buffer shortage is a shortage of space but
  not a shortage of buffer headers, the processes took turns creating
  empty buffers and waking each other to advertise the brelse() of
  the empties; progress was never made because tsleep() always found
  another high-priority process to run and everything was done at
  splbio(), so vfs_update never had a chance to flush delayed writes,
  not to mention that i/o never had a chance to complete.
  
  The problem seems to be rare in practice, but it can easily be
  reproduced by misusing block devices, at least for sufficently slow
  devices on machines with a sufficiently small buffer cache.  E.g.,
  `tar cvf /dev/fd0 /kernel' on an 8MB system with no disk in fd0
  causes the problem quickly; the same command with a disk in fd0
  causes the problem not quite as quickly; and people have reported
  problems newfs'ing file systems on block devices.
  
  Block devices only cause this problem indirectly.  They are pessimized
  for time and space, and the space pessimization causes the shortage
  (it manifests as internal fragmentation in buffer_map).
  
  This should be fixed in 2.2.
  
  Revision  Changes    Path
  1.120     +5 -3      src/sys/kern/vfs_bio.c



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