diff options
author | mdf <mdf@FreeBSD.org> | 2011-02-08 00:16:36 +0000 |
---|---|---|
committer | mdf <mdf@FreeBSD.org> | 2011-02-08 00:16:36 +0000 |
commit | 33ee365b5548dd6130fd6a2707e2169369e1fab6 (patch) | |
tree | 3696b04084e29d2a5b666d5e3854af878bb7879b /sys/kern/vfs_vnops.c | |
parent | 93acd8b57328416a75419b8798763cecaa1bbb29 (diff) | |
download | FreeBSD-src-33ee365b5548dd6130fd6a2707e2169369e1fab6.zip FreeBSD-src-33ee365b5548dd6130fd6a2707e2169369e1fab6.tar.gz |
Based on discussions on the svn-src mailing list, rework r218195:
- entirely eliminate some calls to uio_yeild() as being unnecessary,
such as in a sysctl handler.
- move should_yield() and maybe_yield() to kern_synch.c and move the
prototypes from sys/uio.h to sys/proc.h
- add a slightly more generic kern_yield() that can replace the
functionality of uio_yield().
- replace source uses of uio_yield() with the functional equivalent,
or in some cases do not change the thread priority when switching.
- fix a logic inversion bug in vlrureclaim(), pointed out by bde@.
- instead of using the per-cpu last switched ticks, use a per thread
variable for should_yield(). With PREEMPTION, the only reasonable
use of this is to determine if a lock has been held a long time and
relinquish it. Without PREEMPTION, this is essentially the same as
the per-cpu variable.
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r-- | sys/kern/vfs_vnops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 42abf6e..7b5cad1 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -444,7 +444,7 @@ vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, active_cred, file_cred, * Package up an I/O request on a vnode into a uio and do it. The I/O * request is split up into smaller chunks and we try to avoid saturating * the buffer cache while potentially holding a vnode locked, so we - * check bwillwrite() before calling vn_rdwr(). We also call uio_yield() + * check bwillwrite() before calling vn_rdwr(). We also call kern_yield() * to give other processes a chance to lock the vnode (either other processes * core'ing the same binary, or unrelated processes scanning the directory). */ @@ -491,7 +491,7 @@ vn_rdwr_inchunks(rw, vp, base, len, offset, segflg, ioflg, active_cred, break; offset += chunk; base = (char *)base + chunk; - uio_yield(); + kern_yield(curthread->td_user_pri); } while (len); if (aresid) *aresid = len + iaresid; |