svn commit: r210922 - head/sys/mips/mips
Jayachandran C.
jchandra at FreeBSD.org
Fri Aug 6 09:25:43 UTC 2010
Author: jchandra
Date: Fri Aug 6 09:25:42 2010
New Revision: 210922
URL: http://svn.freebsd.org/changeset/base/210922
Log:
Fix issue reported by alc :
MIPS doesn't really need to use atomic_cmpset_int() in situations like
this because the software dirty bit emulation in trap.c acquires
the pmap lock. Atomics like this appear to be a carryover from i386
where the hardware-managed TLB might concurrently set the modified bit.
Reviewed by: alc
Modified:
head/sys/mips/mips/pmap.c
Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c Fri Aug 6 09:23:47 2010 (r210921)
+++ head/sys/mips/mips/pmap.c Fri Aug 6 09:25:42 2010 (r210922)
@@ -1716,7 +1716,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
vm_page_lock_queues();
PMAP_LOCK(pmap);
for (; sva < eva; sva = va_next) {
- pt_entry_t pbits, obits;
+ pt_entry_t pbits;
vm_page_t m;
vm_paddr_t pa;
@@ -1745,8 +1745,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
/* Skip invalid PTEs */
if (!pte_test(pte, PTE_V))
continue;
-retry:
- obits = pbits = *pte;
+ pbits = *pte;
pa = TLBLO_PTE_TO_PA(pbits);
if (page_is_managed(pa) && pte_test(&pbits, PTE_D)) {
m = PHYS_TO_VM_PAGE(pa);
@@ -1757,8 +1756,7 @@ retry:
pte_set(&pbits, PTE_RO);
if (pbits != *pte) {
- if (!atomic_cmpset_int((u_int *)pte, obits, pbits))
- goto retry;
+ *pte = pbits;
pmap_update_page(pmap, sva, pbits);
}
}
More information about the svn-src-head
mailing list