Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/alpha/alpha alpha: Use load-acquire/store-release.
details: https://anonhg.NetBSD.org/src/rev/5009cce44575
branches: trunk
changeset: 943726:5009cce44575
user: riastradh <riastradh%NetBSD.org@localhost>
date: Tue Sep 08 21:41:37 2020 +0000
description:
alpha: Use load-acquire/store-release.
Omit needless membar in pmap_kenter_pa while here -- caller must
ensure pmap_kenter_pa on one CPU happens before use of the VA on
another CPU anyway, so there is no benefit to a membar here.
ok thorpej@
diffstat:
sys/arch/alpha/alpha/pmap.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diffs (53 lines):
diff -r c0f7593c1425 -r 5009cce44575 sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c Tue Sep 08 19:17:24 2020 +0000
+++ b/sys/arch/alpha/alpha/pmap.c Tue Sep 08 21:41:37 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.271 2020/09/03 02:09:09 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.272 2020/09/08 21:41:37 riastradh Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008, 2020
@@ -135,7 +135,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.271 2020/09/03 02:09:09 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.272 2020/09/08 21:41:37 riastradh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -979,7 +979,7 @@
int backoff = SPINLOCK_BACKOFF_MIN;
u_int spins = 0;
- while (atomic_load_relaxed(&tlb_context) != NULL) {
+ while (atomic_load_acquire(&tlb_context) != NULL) {
SPINLOCK_BACKOFF(backoff);
if (spins++ > 0x0fffffff) {
printf("TLB LOCAL MASK = 0x%016lx\n",
@@ -994,7 +994,6 @@
panic("pmap_tlb_shootnow");
}
}
- membar_consumer();
}
KASSERT(tlb_context == NULL);
#endif /* MULTIPROCESSOR */
@@ -1025,8 +1024,7 @@
KASSERT(tlb_context != NULL);
pmap_tlb_invalidate(tlb_context, ci);
if (atomic_and_ulong_nv(&tlb_pending, ~(1UL << ci->ci_cpuid)) == 0) {
- membar_producer();
- atomic_store_relaxed(&tlb_context, NULL);
+ atomic_store_release(&tlb_context, NULL);
}
}
#endif /* MULTIPROCESSOR */
@@ -2275,7 +2273,6 @@
/* Set the new PTE. */
const pt_entry_t opte = atomic_load_relaxed(pte);
atomic_store_relaxed(pte, npte);
- PMAP_MP(membar_enter());
PMAP_STAT_INCR(pmap->pm_stats.resident_count, 1);
PMAP_STAT_INCR(pmap->pm_stats.wired_count, 1);
Home |
Main Index |
Thread Index |
Old Index