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
This commit is contained in:
Alan Cox 2009-03-05 18:11:26 +00:00
parent a8346a9865
commit cc7d8aabd1

View File

@ -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;