diff options
author | mdf <mdf@FreeBSD.org> | 2011-02-02 16:35:10 +0000 |
---|---|---|
committer | mdf <mdf@FreeBSD.org> | 2011-02-02 16:35:10 +0000 |
commit | b291e9a36525d7da10edd8e2df1a5b70f92905af (patch) | |
tree | 65ff6d1131476610f63482b561b568602f898ff1 /sys/kern/vfs_mount.c | |
parent | 95c40e7f0914505b7f251ea147472c9de5e76cec (diff) | |
download | FreeBSD-src-b291e9a36525d7da10edd8e2df1a5b70f92905af.zip FreeBSD-src-b291e9a36525d7da10edd8e2df1a5b70f92905af.tar.gz |
Put the general logic for being a CPU hog into a new function
should_yield(). Use this in various places. Encapsulate the common
case of check-and-yield into a new function maybe_yield().
Change several checks for a magic number of iterations to use
should_yield() instead.
MFC after: 1 week
Diffstat (limited to 'sys/kern/vfs_mount.c')
-rw-r--r-- | sys/kern/vfs_mount.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 000a544..4ca514b 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1659,9 +1659,8 @@ __mnt_vnode_next(struct vnode **mvp, struct mount *mp) mtx_assert(MNT_MTX(mp), MA_OWNED); KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); - if ((*mvp)->v_yield++ == 500) { + if (should_yield()) { MNT_IUNLOCK(mp); - (*mvp)->v_yield = 0; uio_yield(); MNT_ILOCK(mp); } |