Date: Thu, 17 Oct 2002 18:30:00 -0700 (PDT) From: Kirk McKusick <mckusick@FreeBSD.org> To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern vfs_bio.c Message-ID: <200210180130.g9I1U0Ra004051@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210180130.g9I1U0Ra004051>
