From 0eaffce7b350a432506f61d1240b4021dfced858 Mon Sep 17 00:00:00 2001 From: scottl Date: Tue, 30 Jul 2013 23:26:05 +0000 Subject: 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 --- sys/kern/subr_uio.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sys/kern/subr_uio.c') 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 #include #include +#include #include #ifdef SOCKET_SEND_COW #include @@ -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); -- cgit v1.1