path: root/sys/arm64/arm64/mp_machdep.c
diff options
authorMark Johnston <markj@FreeBSD.org>2018-10-22 20:13:51 +0000
committerMark Johnston <markj@FreeBSD.org>2018-10-22 20:13:51 +0000
commitb61f31429050a1769cd01ca74a6136691f81eebb (patch)
treef80917c35ab077d3ecc375143983ed070bf2d2b8 /sys/arm64/arm64/mp_machdep.c
parenta7d9306a40a7cfd6f82191559b99731cf3dc7f1a (diff)
Make it possible to disable NUMA support with a tunable.
This provides a chicken switch for anyone negatively impacted by enabling NUMA in the amd64 GENERIC kernel configuration. With NUMA disabled at boot-time, information about the NUMA topology is not exposed to the rest of the kernel, and all of physical memory is viewed as coming from a single domain. This method still has some performance overhead relative to disabling NUMA support at compile time. PR: 231460 Reviewed by: alc, gallatin, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17439
Notes: svn path=/head/; revision=339616
Diffstat (limited to 'sys/arm64/arm64/mp_machdep.c')
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c
index aa067d0194e4..241634a0bb44 100644
--- a/sys/arm64/arm64/mp_machdep.c
+++ b/sys/arm64/arm64/mp_machdep.c
@@ -576,11 +576,12 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg)
return (FALSE);
/* Try to read the numa node of this cpu */
- if (OF_getencprop(node, "numa-node-id", &domain, sizeof(domain)) > 0) {
- __pcpu[id].pc_domain = domain;
- if (domain < MAXMEMDOM)
- CPU_SET(id, &cpuset_domain[domain]);
- }
+ if (vm_ndomains == 1 ||
+ OF_getencprop(node, "numa-node-id", &domain, sizeof(domain)) <= 0)
+ domain = 0;
+ __pcpu[id].pc_domain = domain;
+ if (domain < MAXMEMDOM)
+ CPU_SET(id, &cpuset_domain[domain]);
return (TRUE);