From nobody Tue Oct 24 14:37:45 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 4SFF5k0YpZz4y6Vd; Tue, 24 Oct 2023 14:37:46 +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 4SFF5k02fCz4l7Z; Tue, 24 Oct 2023 14:37:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698158266; 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=HZntKxgo+ErB8a+7esWlYNUeoTL7hhByzh9WCjEDdno=; b=eaYGDddSAqqy9PMYsr+hp3PWkhBqoRAfNBAZr39YCdvo4Odlzfr5t8/IH52C072MjuYuhc o0Oo62FA9TfGfVtOO5Xe7+afPtQT14JJFLEo3q5YJ7A57Evl1AnLS+Eeo3oCxRPMKZ9Ik8 La9WBV7jv/JE+D/KnMVNevFmpIf4GfRdITnmcLv1EHxuKcIJhDnMg9c2YDYEzwEieB6SlU viH9ruchPnmEFo7bdeBGwqTX3dC35QkJ2wKiQNwUfVjJ/8vRSETbM+jGWNAkTg6nQFGl+z pe8a27c1ksvO0wahSRTZ2hVLWVdjB7eXwWjZqMvLqFzuDaJTCJdLwFn4XMyAFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698158266; a=rsa-sha256; cv=none; b=L7CYgpjpRpt44yMKpkYd3Chfz69ftQYa0dC5/CWwymeSptlhjVJXLL6GJty3X2xVhAG1S7 lwdhRelV2HQhbWXaejIeyVh5uFzNMjom3AUXvDltksEEairYwzjIqm2Z66Zyv9UUqIkGVN 7FTZWYhtX2toOrvA7KMp5lZTllU2/DtXx2lyu6PD6BeQLBkbmDohAMIdg9aTZLwnnQ4l/p yAC+VlVGbTciK4jucCgVxMzaOddrZ+vednppL16WLzdobhFvDorAN01BrpB2jKlM75dUQA 4JRPgEL78Db9orSfFlZyCfb+ip0H+miphNVTM7BrqU01cGB2OMMg4RncN3+ibQ== 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=1698158266; 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=HZntKxgo+ErB8a+7esWlYNUeoTL7hhByzh9WCjEDdno=; b=wDJH9JD/ExGtBy1evHsogVulGdPGHeFa2ADmN8S2C6SqtnO++iLLEXo1fARGbU4XtNkW0J FeHo9N9IWSZK3igJrdeaele63nYUbVmIkDFVMcCoMTXLrLXT1y0Yuc+OpD8jTHbc4Ygs70 mw+hgHRO4Q+3JC5ILaRdbKePf8+MQK1MO3CC+lorLR/sEB4QgfHu0n2jq6X/cRaO834UTj jHPpVdKlBJV2pUEaVWCPsPEzop49tt7WqLo+wwML6yVNmLWgomViHeh3SdUxoCUINs6wUc OdDZH8slpjCR05igEF2Vsi7GJHwunjv0W8mFn0hUEqKIRr8X0g5EChiX7//c0Q== 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 4SFF5j69lczC94; Tue, 24 Oct 2023 14:37:45 +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 39OEbjZ1089648; Tue, 24 Oct 2023 14:37:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39OEbjRg089645; Tue, 24 Oct 2023 14:37:45 GMT (envelope-from git) Date: Tue, 24 Oct 2023 14:37:45 GMT Message-Id: <202310241437.39OEbjRg089645@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: 00b630cf6262 - releng/14.0 - 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/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 00b630cf6262bfc4ec0a434976c6544c57dc3e04 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=00b630cf6262bfc4ec0a434976c6544c57dc3e04 commit 00b630cf6262bfc4ec0a434976c6544c57dc3e04 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:49 +0000 Commit: Zhenlei Huang CommitDate: 2023-10-24 14:35:51 +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 Approved by: re (gjb) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 (cherry picked from commit c415cfc8be1b732a80f1ada6d52091e08eeb9ab5) (cherry picked from commit e26b7e8d02f648623ad343016533487634a16698) --- 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 108297caac49..bc992bdfc58b 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -76,6 +76,12 @@ _Static_assert(sizeof(long long) >= sizeof(vm_paddr_t), #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; @@ -627,15 +633,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) {