From owner-cvs-all Thu Oct 17 18:30:12 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C80837B401; Thu, 17 Oct 2002 18:30:11 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 64F9943E3B; Thu, 17 Oct 2002 18:30:11 -0700 (PDT) (envelope-from mckusick@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9I1U0mV004064; Thu, 17 Oct 2002 18:30:00 -0700 (PDT) (envelope-from mckusick@repoman.freebsd.org) Received: (from mckusick@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id g9I1U0Ra004051; Thu, 17 Oct 2002 18:30:00 -0700 (PDT) Message-Id: <200210180130.g9I1U0Ra004051@repoman.freebsd.org> From: Kirk McKusick Date: Thu, 17 Oct 2002 18:30:00 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern vfs_bio.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG mckusick 2002/10/17 18:30:00 PDT Modified files: sys/kern vfs_bio.c Log: When the number of dirty buffers rises too high, the buf_daemon runs to help clean up. After selecting a potential buffer to write, this patch has it acquire a lock on the vnode that owns the buffer before trying to write it. The vnode lock is necessary to avoid a race with some other process holding the vnode locked and trying to flush its dirty buffers. In particular, if the vnode in question is a snapshot file, then the race can lead to a deadlock. To avoid slowing down the buf_daemon, it does a non-blocking lock request when trying to lock the vnode. If it fails to get the lock it skips over the buffer and continues down its queue looking for buffers to flush. Sponsored by: DARPA & NAI Labs. Revision Changes Path 1.339 +17 -3 src/sys/kern/vfs_bio.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message