From nobody Thu Oct 19 14:27:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SB96L6lpXz4xVRr; Thu, 19 Oct 2023 14:27:38 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SB96L6FzNz4Wq1; Thu, 19 Oct 2023 14:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697725658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EX+RtpNtSRSOYpby76WWuXzMVB5Fof19sdrIod3Al7k=; b=jHjqk8nVL9nvaZOcn3tbHwpkHbS19o+8AkP2+0HV++KIEJ7pNTXQnRm/PeEI3S+rkJowjy qi2z2y6faLAjuLZSbbb20LAb3nlOxOAUzDqAJBiVy+2y2H2OfRtscWVnh/vLpfsXPls4Zx rbHlirYGVAjiZij+CtUe8PSiSy+Z/VL8EVnTo0Jj8SqSJcZo5mwpfiOtN3zbdZ7qUqzMnG bCpWoG8QtCQUz++YVpcoZhXvvJVhJIxPvEmoj4QM8lhMPj+eyH7pV8jCyVWtnHIWpHe+aC XiBGo7xffOhHHY8Ss1nF84HN8Lll0KVJ9RhIpalYSwLvlGYQSwnCgOwVES5uuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697725658; a=rsa-sha256; cv=none; b=SibXk4TxCpwgOhnDHoKMprOj3DiZu23MpFzLPnvAKnHpmjAFn0ls3rK0J7RuclBwuueCFt HkyxpvyWI8sETwdPT+UraK6vHWp+jNNL6jJv1V0JknB9JAkXxeODoIPnkJuYwPn7z4JzPG nUKDasMVmflOa9n2OO7mXt4Emm6YcV4AcQ/3QNr5P1534GgRejswAXHF2RTTTdwNCYEb/a vPEDEUMi32uC/k7gIIvs6YTNEBPyAFnUHo4SzWPYz5xjt4hzZr67TfDZuLmFqcF1l5xBXE Zih4ToQVhJK3K5iXDsxzFZ2KjlwmICv/Ok4Fn7etOW4KNFd6JCnRFe6b0f5TBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697725658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EX+RtpNtSRSOYpby76WWuXzMVB5Fof19sdrIod3Al7k=; b=jFZ8pGxzn3xAI6u4ZgKQbk88IyQGlMCKTAOnbFKykY7KjySn7idd+IJpfhqmFLJEZ590FJ 3ciS07OmYPihzErD7ZjDV1uPdjKr6s4bxsH9HbjiS8Np2HDKAvt2PBdV7/3SK0WiK8Xbkd iCjO8GQmu9mBtmjf644Gaj74qaBnNR8vtqNqVI10/4zXMzVdSejBKjitAqUxrF8Fw/A+9U UKgK1idEsW86Bd43IjLJNcJLlYEaz5LQ/b4dA7EfmMoJJdoTFaPtZbNTPVdVNc7I1mx2Nf e8Rbupegdgzk1MVibGjHjuDWLWZPtEXfWuBugVezpdcDiXWBxXb52G9PoD6RtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SB96L5C8pzshK; Thu, 19 Oct 2023 14:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39JERcV5078876; Thu, 19 Oct 2023 14:27:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39JERcvU078873; Thu, 19 Oct 2023 14:27:38 GMT (envelope-from git) Date: Thu, 19 Oct 2023 14:27:38 GMT Message-Id: <202310191427.39JERcvU078873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 9aeb24e214c1 - stable/12 - vm_phys: Add corresponding sysctl knob for loader tunable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9aeb24e214c19743bec202e66114aaba37896741 Auto-Submitted: auto-generated The branch stable/12 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=9aeb24e214c19743bec202e66114aaba37896741 commit 9aeb24e214c19743bec202e66114aaba37896741 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:49 +0000 Commit: Zhenlei Huang CommitDate: 2023-10-19 14:26:18 +0000 vm_phys: Add corresponding sysctl knob for loader tunable The loader tunable 'vm.numa.disabled' does not have corresponding sysctl MIB entry. Add it so that it can be retrieved, and `sysctl -T` will also report it correctly. Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 (cherry picked from commit c415cfc8be1b732a80f1ada6d52091e08eeb9ab5) (cherry picked from commit e26b7e8d02f648623ad343016533487634a16698) (cherry picked from commit b180f0040f95973a30fa26f5435e4bbab1197e80) --- sys/vm/vm_phys.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 7fb92cb06220..d4e51936222c 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -76,6 +76,12 @@ _Static_assert(sizeof(long) * NBBY >= VM_PHYSSEG_MAX, #ifdef NUMA struct mem_affinity __read_mostly *mem_affinity; int __read_mostly *mem_locality; + +static int numa_disabled; +static SYSCTL_NODE(_vm, OID_AUTO, numa, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + "NUMA options"); +SYSCTL_INT(_vm_numa, OID_AUTO, disabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, + &numa_disabled, 0, "NUMA-awareness in the allocators is disabled"); #endif int __read_mostly vm_ndomains = 1; @@ -604,15 +610,14 @@ vm_phys_register_domains(int ndomains, struct mem_affinity *affinity, int *locality) { #ifdef NUMA - int d, i; + int i; /* * For now the only override value that we support is 1, which * effectively disables NUMA-awareness in the allocators. */ - d = 0; - TUNABLE_INT_FETCH("vm.numa.disabled", &d); - if (d) + TUNABLE_INT_FETCH("vm.numa.disabled", &numa_disabled); + if (numa_disabled) ndomains = 1; if (ndomains > 1) {