Date: Wed, 25 Sep 2019 01:23:09 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352666 - head/sys/powerpc/powerpc Message-ID: <201909250123.x8P1N9gj092555@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Wed Sep 25 01:23:08 2019 New Revision: 352666 URL: https://svnweb.freebsd.org/changeset/base/352666 Log: powerpc: Allocate DPCPU block from domain-local memory This should improve NUMA scalability a little, by binding to the CPU's NUMA domain. This matches what's done on amd64. Modified: head/sys/powerpc/powerpc/mp_machdep.c Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Wed Sep 25 00:24:57 2019 (r352665) +++ head/sys/powerpc/powerpc/mp_machdep.c Wed Sep 25 01:23:08 2019 (r352666) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include <sys/ktr.h> #include <sys/bus.h> #include <sys/cpuset.h> +#include <sys/domainset.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/mutex.h> @@ -149,7 +150,7 @@ cpu_mp_start(void) { struct cpuref bsp, cpu; struct pcpu *pc; - int error; + int domain, error; error = platform_smp_get_bsp(&bsp); KASSERT(error == 0, ("Don't know BSP")); @@ -166,12 +167,18 @@ cpu_mp_start(void) cpu.cr_cpuid); goto next; } + + if (vm_ndomains > 1) + domain = cpu.cr_domain; + else + domain = 0; + if (cpu.cr_cpuid != bsp.cr_cpuid) { void *dpcpu; pc = &__pcpu[cpu.cr_cpuid]; - dpcpu = (void *)kmem_malloc(DPCPU_SIZE, M_WAITOK | - M_ZERO); + dpcpu = (void *)kmem_malloc_domainset(DOMAINSET_PREF(domain), + DPCPU_SIZE, M_WAITOK | M_ZERO); pcpu_init(pc, cpu.cr_cpuid, sizeof(*pc)); dpcpu_init(dpcpu, cpu.cr_cpuid); } else { @@ -179,12 +186,8 @@ cpu_mp_start(void) pc->pc_cpuid = bsp.cr_cpuid; pc->pc_bsp = 1; } + pc->pc_domain = domain; pc->pc_hwref = cpu.cr_hwref; - - if (vm_ndomains > 1) - pc->pc_domain = cpu.cr_domain; - else - pc->pc_domain = 0; CPU_SET(pc->pc_cpuid, &cpuset_domain[pc->pc_domain]); KASSERT(pc->pc_domain < MAXMEMDOM, ("bad domain value %d\n",
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909250123.x8P1N9gj092555>