From owner-svn-src-all@freebsd.org Wed Sep 25 01:23:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7C63F7726; Wed, 25 Sep 2019 01:23:09 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46dL0Y3ygHz4Fbk; Wed, 25 Sep 2019 01:23:09 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C55C8383; Wed, 25 Sep 2019 01:23:09 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8P1N93s092556; Wed, 25 Sep 2019 01:23:09 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8P1N9gj092555; Wed, 25 Sep 2019 01:23:09 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201909250123.x8P1N9gj092555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 25 Sep 2019 01:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352666 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 352666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Sep 2019 01:23:09 -0000 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 #include #include +#include #include #include #include @@ -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",