summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2009-03-05 18:11:26 +0000
committeralc <alc@FreeBSD.org>2009-03-05 18:11:26 +0000
commit1c25cf18c16fd426e55126c6e3155fa8567fdca2 (patch)
treeedaff7b8eb763ac404de3f22104fe2cc6842f157
parent059d33034711cd836d72958de8f1d7a5654d067f (diff)
downloadFreeBSD-src-1c25cf18c16fd426e55126c6e3155fa8567fdca2.zip
FreeBSD-src-1c25cf18c16fd426e55126c6e3155fa8567fdca2.tar.gz
Make pmap_copy() more TLB friendly. Specifically, make it use the kernel's
direct map instead of the pmap's recursive mapping to access the lowest level in the page table. MFC after: 6 weeks
-rw-r--r--sys/amd64/amd64/pmap.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 4050bd9..6f66042 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -3481,9 +3481,6 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len,
if (dst_addr != src_addr)
return;
- if (!pmap_is_current(src_pmap))
- return;
-
vm_page_lock_queues();
if (dst_pmap < src_pmap) {
PMAP_LOCK(dst_pmap);
@@ -3545,14 +3542,16 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len,
continue;
}
- srcmpte = PHYS_TO_VM_PAGE(srcptepaddr & PG_FRAME);
+ srcptepaddr &= PG_FRAME;
+ srcmpte = PHYS_TO_VM_PAGE(srcptepaddr);
KASSERT(srcmpte->wire_count > 0,
("pmap_copy: source page table page is unused"));
if (va_next > end_addr)
va_next = end_addr;
- src_pte = vtopte(addr);
+ src_pte = (pt_entry_t *)PHYS_TO_DMAP(srcptepaddr);
+ src_pte = &src_pte[pmap_pte_index(addr)];
while (addr < va_next) {
pt_entry_t ptetemp;
ptetemp = *src_pte;
OpenPOWER on IntegriCloud