summaryrefslogtreecommitdiffstats
path: root/sys/vm/device_pager.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2013-08-09 11:28:55 +0000
committerattilio <attilio@FreeBSD.org>2013-08-09 11:28:55 +0000
commite9f37cac7422f86c8a65b4c123705f5dccd43fa1 (patch)
tree589f2433c8a0e985a4f0aeb058fbbf1b412b6f98 /sys/vm/device_pager.c
parent3f74b0e634cf4f4b3796e44533e8318ef773c3e9 (diff)
downloadFreeBSD-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/vm/device_pager.c')
-rw-r--r--sys/vm/device_pager.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c
index fd20664..ba193e9 100644
--- a/sys/vm/device_pager.c
+++ b/sys/vm/device_pager.c
@@ -348,11 +348,12 @@ old_dev_pager_fault(vm_object_t object, vm_ooffset_t offset, int prot,
*/
page = vm_page_getfake(paddr, memattr);
VM_OBJECT_WLOCK(object);
+ if (vm_page_replace(page, object, (*mres)->pindex) != *mres)
+ panic("old_dev_pager_fault: invalid page replacement");
vm_page_lock(*mres);
vm_page_free(*mres);
vm_page_unlock(*mres);
*mres = page;
- vm_page_insert(page, object, pidx);
}
page->valid = VM_PAGE_BITS_ALL;
return (VM_PAGER_OK);
OpenPOWER on IntegriCloud