svn commit: r215372 - stable/8/sys/i386/i386
Alan Cox
alc at FreeBSD.org
Tue Nov 16 05:06:20 UTC 2010
Author: alc
Date: Tue Nov 16 05:06:20 2010
New Revision: 215372
URL: http://svn.freebsd.org/changeset/base/215372
Log:
MFC r214938
Eliminate a possible race between pmap_pinit() and pmap_kenter_pde() on
superpage promotion or demotion.
Micro-optimize pmap_kenter_pde().
Modified:
stable/8/sys/i386/i386/pmap.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/xen/xenpci/ (props changed)
Modified: stable/8/sys/i386/i386/pmap.c
==============================================================================
--- stable/8/sys/i386/i386/pmap.c Tue Nov 16 05:01:27 2010 (r215371)
+++ stable/8/sys/i386/i386/pmap.c Tue Nov 16 05:06:20 2010 (r215372)
@@ -1649,11 +1649,19 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t v
return pmap_unwire_pte_hold(pmap, mpte, free);
}
+/*
+ * Initialize the pmap for the swapper process.
+ */
void
pmap_pinit0(pmap_t pmap)
{
PMAP_LOCK_INIT(pmap);
+ /*
+ * Since the page table directory is shared with the kernel pmap,
+ * which is already included in the list "allpmaps", this pmap does
+ * not need to be inserted into that list.
+ */
pmap->pm_pdir = (pd_entry_t *)(KERNBASE + (vm_offset_t)IdlePTD);
#ifdef PAE
pmap->pm_pdpt = (pdpt_entry_t *)(KERNBASE + (vm_offset_t)IdlePDPT);
@@ -1663,9 +1671,6 @@ pmap_pinit0(pmap_t pmap)
PCPU_SET(curpmap, pmap);
TAILQ_INIT(&pmap->pm_pvchunk);
bzero(&pmap->pm_stats, sizeof pmap->pm_stats);
- mtx_lock_spin(&allpmaps_lock);
- LIST_INSERT_HEAD(&allpmaps, pmap, pm_list);
- mtx_unlock_spin(&allpmaps_lock);
}
/*
@@ -1730,9 +1735,9 @@ pmap_pinit(pmap_t pmap)
mtx_lock_spin(&allpmaps_lock);
LIST_INSERT_HEAD(&allpmaps, pmap, pm_list);
- mtx_unlock_spin(&allpmaps_lock);
- /* Wire in kernel global address entries. */
+ /* Copy the kernel page table directory entries. */
bcopy(PTD + KPTDI, pmap->pm_pdir + KPTDI, nkpt * sizeof(pd_entry_t));
+ mtx_unlock_spin(&allpmaps_lock);
/* install self-referential address mapping entry(s) */
for (i = 0; i < NPGPTD; i++) {
More information about the svn-src-all
mailing list