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/sun4v | |
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/sun4v')
-rw-r--r-- | sys/sun4v/sun4v/uio_machdep.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/sun4v/sun4v/uio_machdep.c b/sys/sun4v/sun4v/uio_machdep.c index bee80d6..5139912 100644 --- a/sys/sun4v/sun4v/uio_machdep.c +++ b/sys/sun4v/sun4v/uio_machdep.c @@ -94,8 +94,7 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) cp = (char *)TLB_PHYS_TO_DIRECT(pa) + page_offset; switch (uio->uio_segflg) { case UIO_USERSPACE: - if (ticks - PCPU_GET(switchticks) >= hogticks) - uio_yield(); + maybe_yield(); if (uio->uio_rw == UIO_READ) error = copyout(cp, iov->iov_base, cnt); else |