summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_subr.c
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>2003-03-08 06:58:18 +0000
committerken <ken@FreeBSD.org>2003-03-08 06:58:18 +0000
commit471eab186865eefb189ac9c549a17b283ff5af57 (patch)
treebafe4813576a96350c2cecf2d6c1355c00e092d0 /sys/kern/kern_subr.c
parentdd4ead08fe3ba22637eed709529fd9dc6da2b6c6 (diff)
downloadFreeBSD-src-471eab186865eefb189ac9c549a17b283ff5af57.zip
FreeBSD-src-471eab186865eefb189ac9c549a17b283ff5af57.tar.gz
Zero copy send and receive fixes:
- On receive, vm_map_lookup() needs to trigger the creation of a shadow object. To make that happen, call vm_map_lookup() with PROT_WRITE instead of PROT_READ in vm_pgmoveco(). - On send, a shadow object will be created by the vm_map_lookup() in vm_fault(), but vm_page_cowfault() will delete the original page from the backing object rather than simply letting the legacy COW mechanism take over. In other words, the new page should be added to the shadow object rather than replacing the old page in the backing object. (i.e. vm_page_cowfault() should not be called in this case.) We accomplish this by making sure fs.object == fs.first_object before calling vm_page_cowfault() in vm_fault(). Submitted by: gallatin, alc Tested by: ken
Diffstat (limited to 'sys/kern/kern_subr.c')
-rw-r--r--sys/kern/kern_subr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c
index 6728e8d..a5d6d0f 100644
--- a/sys/kern/kern_subr.c
+++ b/sys/kern/kern_subr.c
@@ -87,7 +87,7 @@ vm_pgmoveco(vm_map_t mapa, vm_object_t srcobj, vm_offset_t kaddr,
kern_pg = PHYS_TO_VM_PAGE(vtophys(kaddr));
if ((vm_map_lookup(&map, uaddr,
- VM_PROT_READ, &entry, &uobject,
+ VM_PROT_WRITE, &entry, &uobject,
&upindex, &prot, &wired)) != KERN_SUCCESS) {
return(EFAULT);
}
OpenPOWER on IntegriCloud