From nobody Tue Oct 24 14:37:44 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 4SFF5j0GWgz4y6s2; Tue, 24 Oct 2023 14:37:45 +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 4SFF5h5z33z4l8g; Tue, 24 Oct 2023 14:37:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698158264; 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=RzFKzjGVZk439L/UR/+PR2cHpVQASDYHlIrlcM5Yq6Y=; b=byiLmmUUVT8kzm6ZThSp+d61Qd1ZkdA1GBbWE/Ef4Ry8n97D7XCxCGH00mRW4Qi/Qw5bng BtH4GjlvEcLxS8r2CD26I0WnCV6X4KWx6Qm2Ak4YGlVVTY50PjFiw/u7UIDenS6KNFoGqR KPYTU9wi0fgNlwA3yDLnQuyoMcxHKqteS0/QwnJ19oyGXd1zXFr7QcgbvrEFy0ChIe263B rs0n6evF3o4QF7UEj/5QBGOZxBV7FFO1+1I8gVnME88NXrDc2MgpbB0Y0fHyLr3qQNL3ru EIhCxPUszvhLv+TyfCTrWHYdO72uPuGnVFImxaFcGJRLwjlt3DuArVrqhgI+aA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698158264; a=rsa-sha256; cv=none; b=Q3FgRLuKWb93mCQV4KgPBMcRZ+ITawiCQ0o8klHEWHSpAmuRouBe4OmmyX1+MIMCqRnhDH jZgGPusdA9ixEwQfB/cWrWA15CQJxIYEweEdtKkg0eQobkX0Z0e3mv0KMAHwwWfC8hqzn6 h2UcEUZ2edachAU/z7Rk3GtkiC7wG2AN+LnMbfy1Hmnz7FiDIHQYgMWAfGQBrLobJ1fH8O +q3ilIGzXNTrLNHtV8TKQGVkdk6y0lxsxfwRODdtqyjXa7pdeDicTTcQvmmmI4mTU+hyuy t4k4ylFccYntCgYRfkG3sh1a137fHd/M5SU8X559Pbh522htCZWT+3uexN9eXQ== 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=1698158264; 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=RzFKzjGVZk439L/UR/+PR2cHpVQASDYHlIrlcM5Yq6Y=; b=Kjcfj4p7tdIWk03zXbFnxVwULPMnejYE4zi0XZFr1ptSJX3kKlzeK3O3so4bsteZaVzaTn Y67oA135FFMKMCuFhEV2hXG4m8zd5a9Vy2yAp6jN3aQIPK57Ft5qo1QC8zYpbbIWaqweNa SQxpC+qTb8rFPQUrqkziZ7zmR+qV8GO44wapZlgFsA0MC3VXHGImneWRjlKb8cJDuob2pS CbudO53E+Wh3mVdp9zrBA2tQlaJB7hTaFgnLB3kdkQOYO74eAGBulGGvpNrx/+qG6HbgTI R1y4xAduMhP/Q9YuK1a7c/DHUGQKO5z+kh1/becGerV7KbTWzN1EedNmbHXp4A== 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 4SFF5h54XgzBt1; Tue, 24 Oct 2023 14:37:44 +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 39OEbiD0089597; Tue, 24 Oct 2023 14:37:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39OEbiFH089594; Tue, 24 Oct 2023 14:37:44 GMT (envelope-from git) Date: Tue, 24 Oct 2023 14:37:44 GMT Message-Id: <202310241437.39OEbiFH089594@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: 5c23cc232716 - releng/14.0 - vm_page: 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: 5c23cc232716a56d789a6c89681d520fcddc1696 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5c23cc232716a56d789a6c89681d520fcddc1696 commit 5c23cc232716a56d789a6c89681d520fcddc1696 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:49 +0000 Commit: Zhenlei Huang CommitDate: 2023-10-24 14:35:51 +0000 vm_page: Add corresponding sysctl knob for loader tunable The loader tunable 'vm.pgcache_zone_max_pcpu' 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 a55fbda874db31b804490567c69502c891b6ff61) (cherry picked from commit cb5bc8a748dfefc68e3905e8fdf17e0484844383) --- sys/vm/vm_page.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 4f3c4ba2d4d7..8496a39154de 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -198,6 +198,11 @@ vm_page_init(void *dummy) bogus_page = vm_page_alloc_noobj(VM_ALLOC_WIRED); } +static int pgcache_zone_max_pcpu; +SYSCTL_INT(_vm, OID_AUTO, pgcache_zone_max_pcpu, + CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &pgcache_zone_max_pcpu, 0, + "Per-CPU page cache size"); + /* * The cache page zone is initialized later since we need to be able to allocate * pages before UMA is fully initialized. @@ -209,9 +214,8 @@ vm_page_init_cache_zones(void *dummy __unused) struct vm_pgcache *pgcache; int cache, domain, maxcache, pool; - maxcache = 0; - TUNABLE_INT_FETCH("vm.pgcache_zone_max_pcpu", &maxcache); - maxcache *= mp_ncpus; + TUNABLE_INT_FETCH("vm.pgcache_zone_max_pcpu", &pgcache_zone_max_pcpu); + maxcache = pgcache_zone_max_pcpu * mp_ncpus; for (domain = 0; domain < vm_ndomains; domain++) { vmd = VM_DOMAIN(domain); for (pool = 0; pool < VM_NFREEPOOL; pool++) {