diff options
author | marius <marius@FreeBSD.org> | 2011-06-20 21:36:53 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2011-06-20 21:36:53 +0000 |
commit | 4c37601f59a15c3cc664349bb10e6c1039441cab (patch) | |
tree | 224c91a8dc00c74370bec32083be737196188f37 | |
parent | 4199d2d7b1ffb8473dbb149224baded9c2d3e215 (diff) | |
download | FreeBSD-src-4c37601f59a15c3cc664349bb10e6c1039441cab.zip FreeBSD-src-4c37601f59a15c3cc664349bb10e6c1039441cab.tar.gz |
As astopgap minimize the sched_lock coverage in pmap_activate() in order
to reduce lock contention.
-rw-r--r-- | sys/sparc64/sparc64/pmap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c index 619796c..876dce3 100644 --- a/sys/sparc64/sparc64/pmap.c +++ b/sys/sparc64/sparc64/pmap.c @@ -2217,11 +2217,10 @@ pmap_activate(struct thread *td) struct pmap *pm; int context; + critical_enter(); vm = td->td_proc->p_vmspace; pm = vmspace_pmap(vm); - mtx_lock_spin(&sched_lock); - context = PCPU_GET(tlb_ctx); if (context == PCPU_GET(tlb_ctx_max)) { tlb_flush_user(); @@ -2229,17 +2228,18 @@ pmap_activate(struct thread *td) } PCPU_SET(tlb_ctx, context + 1); + mtx_lock_spin(&sched_lock); pm->pm_context[curcpu] = context; CPU_SET(PCPU_GET(cpuid), &pm->pm_active); PCPU_SET(pmap, pm); + mtx_unlock_spin(&sched_lock); stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); stxa(AA_IMMU_TSB, ASI_IMMU, pm->pm_tsb); stxa(AA_DMMU_PCXR, ASI_DMMU, (ldxa(AA_DMMU_PCXR, ASI_DMMU) & TLB_CXR_PGSZ_MASK) | context); flush(KERNBASE); - - mtx_unlock_spin(&sched_lock); + critical_exit(); } void |