diff options
author | scottl <scottl@FreeBSD.org> | 2013-07-30 23:26:05 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2013-07-30 23:26:05 +0000 |
commit | 0eaffce7b350a432506f61d1240b4021dfced858 (patch) | |
tree | 60c2d9f5e9fd2f5d373f58c5e67f4dc9baf09de0 /sys/kern/subr_uio.c | |
parent | d13c0062851638685f23ad2a414ca3b0e71ba340 (diff) | |
download | FreeBSD-src-0eaffce7b350a432506f61d1240b4021dfced858.zip FreeBSD-src-0eaffce7b350a432506f61d1240b4021dfced858.tar.gz |
Create a knob, kern.ipc.sfreadahead, that allows one to tune the amount of
readahead that sendfile() will do. Default remains the same.
Obtained from: Netflix
MFC after: 3 days
Diffstat (limited to 'sys/kern/subr_uio.c')
-rw-r--r-- | sys/kern/subr_uio.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/subr_uio.c b/sys/kern/subr_uio.c index 1ee265c..efa483f 100644 --- a/sys/kern/subr_uio.c +++ b/sys/kern/subr_uio.c @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_param.h> #include <vm/vm_extern.h> #include <vm/vm_page.h> +#include <vm/vm_pageout.h> #include <vm/vm_map.h> #ifdef SOCKET_SEND_COW #include <vm/vm_object.h> @@ -122,7 +123,12 @@ retry: if (uobject->backing_object != NULL) pmap_remove(map->pmap, uaddr, uaddr + PAGE_SIZE); } - vm_page_insert(kern_pg, uobject, upindex); + if (vm_page_insert(kern_pg, uobject, upindex)) { + VM_OBJECT_WUNLOCK(uobject); + VM_WAIT; + VM_OBJECT_WLOCK(uobject); + goto retry; + } vm_page_dirty(kern_pg); VM_OBJECT_WUNLOCK(uobject); vm_map_lookup_done(map, entry); |