diff options
author | attilio <attilio@FreeBSD.org> | 2013-08-09 11:28:55 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-08-09 11:28:55 +0000 |
commit | e9f37cac7422f86c8a65b4c123705f5dccd43fa1 (patch) | |
tree | 589f2433c8a0e985a4f0aeb058fbbf1b412b6f98 /sys/kern/subr_uio.c | |
parent | 3f74b0e634cf4f4b3796e44533e8318ef773c3e9 (diff) | |
download | FreeBSD-src-e9f37cac7422f86c8a65b4c123705f5dccd43fa1.zip FreeBSD-src-e9f37cac7422f86c8a65b4c123705f5dccd43fa1.tar.gz |
On all the architectures, avoid to preallocate the physical memory
for nodes used in vm_radix.
On architectures supporting direct mapping, also avoid to pre-allocate
the KVA for such nodes.
In order to do so make the operations derived from vm_radix_insert()
to fail and handle all the deriving failure of those.
vm_radix-wise introduce a new function called vm_radix_replace(),
which can replace a leaf node, already present, with a new one,
and take into account the possibility, during vm_radix_insert()
allocation, that the operations on the radix trie can recurse.
This means that if operations in vm_radix_insert() recursed
vm_radix_insert() will start from scratch again.
Sponsored by: EMC / Isilon storage division
Reviewed by: alc (older version)
Reviewed by: jeff
Tested by: pho, scottl
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 bc7ba98..53f87c0 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); |