Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm/pmap Don't kcpuset_clone every pmap_tlb_shootdown_by...
details: https://anonhg.NetBSD.org/src/rev/713dbd03057b
branches: trunk
changeset: 937103:713dbd03057b
user: skrll <skrll%NetBSD.org@localhost>
date: Sun Aug 09 06:26:49 2020 +0000
description:
Don't kcpuset_clone every pmap_tlb_shootdown_bystanders. Instead allocate
a kcpuset_t per cpu_info and use that.
diffstat:
sys/arch/mips/include/cpu.h | 3 ++-
sys/arch/mips/mips/cpu_subr.c | 5 +++--
sys/uvm/pmap/pmap_tlb.c | 11 +++++------
3 files changed, 10 insertions(+), 9 deletions(-)
diffs (82 lines):
diff -r 26a98d5a6447 -r 713dbd03057b sys/arch/mips/include/cpu.h
--- a/sys/arch/mips/include/cpu.h Sun Aug 09 05:51:04 2020 +0000
+++ b/sys/arch/mips/include/cpu.h Sun Aug 09 06:26:49 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.129 2020/07/26 08:08:41 simonb Exp $ */
+/* $NetBSD: cpu.h,v 1.130 2020/08/09 06:26:49 skrll Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -151,6 +151,7 @@
#define CPUF_RUNNING 0x04 /* CPU is running */
#define CPUF_PAUSED 0x08 /* CPU is paused */
#define CPUF_USERPMAP 0x20 /* CPU has a user pmap activated */
+ kcpuset_t *ci_shootdowncpus;
kcpuset_t *ci_multicastcpus;
kcpuset_t *ci_watchcpus;
kcpuset_t *ci_ddbcpus;
diff -r 26a98d5a6447 -r 713dbd03057b sys/arch/mips/mips/cpu_subr.c
--- a/sys/arch/mips/mips/cpu_subr.c Sun Aug 09 05:51:04 2020 +0000
+++ b/sys/arch/mips/mips/cpu_subr.c Sun Aug 09 06:26:49 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_subr.c,v 1.56 2020/07/21 06:01:10 simonb Exp $ */
+/* $NetBSD: cpu_subr.c,v 1.57 2020/08/09 06:26:49 skrll Exp $ */
/*-
* Copyright (c) 2010, 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.56 2020/07/21 06:01:10 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.57 2020/08/09 06:26:49 skrll Exp $");
#include "opt_cputype.h"
#include "opt_ddb.h"
@@ -291,6 +291,7 @@
*/
ipi_init(ci);
+ kcpuset_create(&ci->ci_shootdowncpus, true);
kcpuset_create(&ci->ci_multicastcpus, true);
kcpuset_create(&ci->ci_watchcpus, true);
kcpuset_create(&ci->ci_ddbcpus, true);
diff -r 26a98d5a6447 -r 713dbd03057b sys/uvm/pmap/pmap_tlb.c
--- a/sys/uvm/pmap/pmap_tlb.c Sun Aug 09 05:51:04 2020 +0000
+++ b/sys/uvm/pmap/pmap_tlb.c Sun Aug 09 06:26:49 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_tlb.c,v 1.33 2020/04/14 05:43:57 skrll Exp $ */
+/* $NetBSD: pmap_tlb.c,v 1.34 2020/08/09 06:26:49 skrll Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.33 2020/04/14 05:43:57 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.34 2020/08/09 06:26:49 skrll Exp $");
/*
* Manages address spaces in a TLB.
@@ -643,8 +643,9 @@
UVMHIST_FUNC(__func__);
UVMHIST_CALLARGS(maphist, "pm %#jx", (uintptr_t)pm, 0, 0, 0);
- kcpuset_t *pm_active;
- kcpuset_clone(&pm_active, pm->pm_active);
+ const struct cpu_info * const ci = curcpu();
+ kcpuset_t *pm_active = ci->ci_shootdowncpus;
+ kcpuset_copy(pm_active, pm->pm_active);
kcpuset_remove(pm_active, cpu_tlb_info(curcpu())->ti_kcpuset);
const bool kernel_p = (pm == pmap_kernel());
bool ipi_sent = false;
@@ -719,8 +720,6 @@
TLBINFO_UNLOCK(ti);
}
- kcpuset_destroy(pm_active);
-
UVMHIST_LOG(maphist, " <-- done (ipi_sent=%jd)", ipi_sent, 0, 0, 0);
return ipi_sent;
Home |
Main Index |
Thread Index |
Old Index