summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_pager.c
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2002-03-17 00:56:41 +0000
committerjake <jake@FreeBSD.org>2002-03-17 00:56:41 +0000
commit34dcf8975d103d034d7e8b6788c0645cc93af254 (patch)
tree8cbe6dabf99b708d371412e48b9c89cb8897e02b /sys/vm/vm_pager.c
parent80729196189279faca005d50e34c4dfc09122e3c (diff)
downloadFreeBSD-src-34dcf8975d103d034d7e8b6788c0645cc93af254.zip
FreeBSD-src-34dcf8975d103d034d7e8b6788c0645cc93af254.tar.gz
Convert all pmap_kenter/pmap_kremove pairs in MI code to use pmap_qenter/
pmap_qremove. pmap_kenter is not safe to use in MI code because it is not guaranteed to flush the mapping from the tlb on all cpus. If the process in question is preempted and migrates cpus between the call to pmap_kenter and pmap_kremove, the original cpu will be left with stale mappings in its tlb. This is currently not a problem for i386 because we do not use PG_G on SMP, and thus all mappings are flushed from the tlb on context switches, not just user mappings. This is not the case on all architectures, and if PG_G is to be used with SMP on i386 it will be a problem. This was committed by peter earlier as part of his fine grained tlb shootdown work for i386, which was backed out for other reasons. Reviewed by: peter
Diffstat (limited to 'sys/vm/vm_pager.c')
-rw-r--r--sys/vm/vm_pager.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c
index ae71996..60f7e72 100644
--- a/sys/vm/vm_pager.c
+++ b/sys/vm/vm_pager.c
@@ -318,7 +318,7 @@ vm_pager_map_page(m)
vm_offset_t kva;
kva = kmem_alloc_wait(pager_map, PAGE_SIZE);
- pmap_kenter(kva, VM_PAGE_TO_PHYS(m));
+ pmap_qenter(kva, &m, 1);
return (kva);
}
@@ -326,7 +326,8 @@ void
vm_pager_unmap_page(kva)
vm_offset_t kva;
{
- pmap_kremove(kva);
+
+ pmap_qremove(kva, 1);
kmem_free_wakeup(pager_map, kva, PAGE_SIZE);
}
OpenPOWER on IntegriCloud