diff options
author | mckusick <mckusick@FreeBSD.org> | 2003-11-04 06:30:00 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2003-11-04 06:30:00 +0000 |
commit | 993e4dcc976ccff83cc9267347030a205cac7c93 (patch) | |
tree | 10dad0a2bf40b9691a90cb283207119c27ee7526 /sys/kern | |
parent | 4e6189970a82e85437ba05beb21a8aa02e1c4ffa (diff) | |
download | FreeBSD-src-993e4dcc976ccff83cc9267347030a205cac7c93.zip FreeBSD-src-993e4dcc976ccff83cc9267347030a205cac7c93.tar.gz |
Allow the bufdaemon and update daemon processes to skip the
waitrunningbufspace() calls so that they are always able to
proceed and clean up buffer space.
Submitted by: Brian Fundakowski Feldman <green@freebsd.org>
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_bio.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 526429d..6a80565 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -72,6 +72,8 @@ struct buf_ops buf_ops_bio = { */ struct buf *buf; /* buffer header pool */ +static struct proc *bufdaemonproc; + static void vm_hold_free_pages(struct buf * bp, vm_offset_t from, vm_offset_t to); static void vm_hold_load_pages(struct buf * bp, vm_offset_t from, @@ -888,9 +890,13 @@ bwrite(struct buf * bp) * don't allow the async write to saturate the I/O * system. We will not deadlock here because * we are blocking waiting for I/O that is already in-progress - * to complete. + * to complete. We do not block here if it is the update + * or syncer daemon trying to clean up as that can lead + * to deadlock. */ - waitrunningbufspace(); + if (curthread->td_proc != bufdaemonproc && + curthread->td_proc != updateproc) + waitrunningbufspace(); } return (0); @@ -2040,8 +2046,6 @@ restart: * take the load in an attempt to prevent getnewbuf() from blocking. */ -static struct proc *bufdaemonproc; - static struct kproc_desc buf_kp = { "bufdaemon", buf_daemon, |