aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Libby <rlibby@FreeBSD.org>2020-12-18 08:29:38 +0000
committerRyan Libby <rlibby@FreeBSD.org>2020-12-18 08:29:38 +0000
commit12fc18b805376002ff195f2f4edebf179edd2a9c (patch)
tree5e9252186e114177d5ccdabb0f07f6f3529a2f14
parent9604797048ac7a1ae9af22e85bca5bfedbb847fa (diff)
downloadsrc-12fc18b805376002ff195f2f4edebf179edd2a9c.tar.gz
src-12fc18b805376002ff195f2f4edebf179edd2a9c.zip
MFC r357019:
uma: fix zone domain overlaying pcpu cache with disabled cpus UMA zone structures have two arrays at the end which are sized according to the machine: an array of CPU count length, and an array of NUMA domain count length. The CPU counting was wrong in the case where some CPUs are disabled (when mp_ncpus != mp_maxid + 1), and this caused the second array to be overlaid with the first. Reported by: olivier Reviewed by: jeff, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23318
Notes
Notes: svn path=/stable/12/; revision=368752
-rw-r--r--sys/vm/uma_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index a617e5fb392e..b370f1b67c7b 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -1782,7 +1782,8 @@ zone_ctor(void *mem, int size, void *udata, int flags)
zone->uz_flags = 0;
zone->uz_warning = NULL;
/* The domain structures follow the cpu structures. */
- zone->uz_domain = (struct uma_zone_domain *)&zone->uz_cpu[mp_ncpus];
+ zone->uz_domain =
+ (struct uma_zone_domain *)&zone->uz_cpu[mp_maxid + 1];
timevalclear(&zone->uz_ratecheck);
keg = arg->keg;