diff options
author | Matthew D Fleming <mdf@FreeBSD.org> | 2011-02-02 16:35:10 +0000 |
---|---|---|
committer | Matthew D Fleming <mdf@FreeBSD.org> | 2011-02-02 16:35:10 +0000 |
commit | 08b163fa51d57ffe78bbdcc7a7912243dbb8b853 (patch) | |
tree | 65ff6d1131476610f63482b561b568602f898ff1 /sys/arm | |
parent | 01ab52c021a91c6b536f335ce3d8f60d2102e140 (diff) | |
download | src-08b163fa51d57ffe78bbdcc7a7912243dbb8b853.tar.gz src-08b163fa51d57ffe78bbdcc7a7912243dbb8b853.zip |
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
Notes
Notes:
svn path=/head/; revision=218195
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/arm/uio_machdep.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/arm/arm/uio_machdep.c b/sys/arm/arm/uio_machdep.c index bc52a6e5dc4e..0a8e4adddc1d 100644 --- a/sys/arm/arm/uio_machdep.c +++ b/sys/arm/arm/uio_machdep.c @@ -94,8 +94,7 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) cp = (char*)sf_buf_kva(sf) + 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 |