From owner-cvs-sys Fri Jun 13 01:34:47 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id BAA18233 for cvs-sys-outgoing; Fri, 13 Jun 1997 01:34:47 -0700 (PDT) Received: from freefall.freebsd.org (freefall.cdrom.com [204.216.27.21]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id BAA18035; Fri, 13 Jun 1997 01:31:02 -0700 (PDT) From: Bruce Evans Received: (from bde@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id BAA17252; Fri, 13 Jun 1997 01:30:41 -0700 (PDT) Date: Fri, 13 Jun 1997 01:30:41 -0700 (PDT) Message-Id: <199706130830.BAA17252@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-sys@FreeBSD.ORG Subject: cvs commit: src/sys/kern vfs_bio.c Sender: owner-cvs-sys@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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