From nobody Thu Oct 19 14:02:49 2023 X-Original-To: dev-commits-src-branches@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 4SB8Yk22Rzz4xT7T; Thu, 19 Oct 2023 14:02:50 +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 4SB8Yk1Y3cz4S8Z; Thu, 19 Oct 2023 14:02:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697724170; 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=3+auakrWNKwX766Y057MUEai3QqulBkNZE1mjJpQ420=; b=eVJODSSquDYd4m5uk0xyzmGFkExGDPuxIyP1RyTnb30pDbAxEUlv3+ZznjH6UkXJ2eK64G DsAouAzkShwCJNZY4sDt3VrSYNdLV/7fsggeMjchyEbvbEgMHaQ4F1281npW3Ao3fF6UrE qRsaGTwstkBjKXaN9KKSjZF0AGEbZ9shn/nHfDJedudTCYZg0GnhFjjxLjbun0EtzQHXXr SRk4lB721gWvf9jtZt8qq69xl7fFi6sZxDNgkx5F/ztTWK+E2z1JDICsnoPMvCoLeuXLU/ znC3ApHqCgOFKhWQ4E2GPrWKj5/Yfne56UNRDCi+u9aN4J3PxdGzk7JAjDuLLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697724170; a=rsa-sha256; cv=none; b=jetQ2UdE9mEi6w0dhnDgl0itUxbJ0/GlSuVtPPv8TTpbGRj3NjTVhM+8TftjolJQTPoiTj M8cHXA3yiQoDu1iUrulGJmiZGo7YWyq94mftapMUDkwxKbmPbMB66x6tNIcC935C2LfTXm HTls8U1r5uZ/AZdAu86tuOaTJsUXvl+nUM2Sy8GvZTlBn42FOZzTfcu99cny+Ti4GZMqvs +5Z+yDvXdKhQ/B42LLn3tK7OZQmTo7upizpNLkIUpDhSZPqX0kuOU9PHopuMYCxQUfubN1 Z+i/e6aVwlHPgmqnAItmp9fPcc8ktyv7cTbavEfhiu8qRcO/cpBXh5vAKui+MQ== 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=1697724170; 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=3+auakrWNKwX766Y057MUEai3QqulBkNZE1mjJpQ420=; b=Dt1nw6KWmZCkx1MVJjn61Uw/oZpDcafAfiwUOOGlPz+Bgq30niHudr9ETiMoCEGi3aRMS6 MfMcSHHXl/og8eLMAqRGhCY5hTRrTZHzTPXnzQMPu4ntE5K8/pfunLI6FB0usM0OwhxZcv BrWvhUmpIvhe3xiBIVB6ElkWm5uwgDB3Zz83csZ/Zxl3ZA+107p5psB7gqGGuE5FjQB4R1 SM2iTlJUphIo15KeMS4+UyLCNKFFwYqT8zls5Tcz0wuAxnzfEmXF1kAaVEPGaiFLGmlzZQ +9UVgv5pLR+bqJqSp4p4Hi+YFQWxL2UUc9J6uajq6dp9Etzixo5Jd+GsI65Ntw== 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 4SB8Yk0djGzsc4; Thu, 19 Oct 2023 14:02:50 +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 39JE2nna044911; Thu, 19 Oct 2023 14:02:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39JE2nRJ044908; Thu, 19 Oct 2023 14:02:49 GMT (envelope-from git) Date: Thu, 19 Oct 2023 14:02:49 GMT Message-Id: <202310191402.39JE2nRJ044908@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: cb5bc8a748df - stable/14 - vm_page: Add corresponding sysctl knob for loader tunable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/14 X-Git-Reftype: branch X-Git-Commit: cb5bc8a748dfefc68e3905e8fdf17e0484844383 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=cb5bc8a748dfefc68e3905e8fdf17e0484844383 commit cb5bc8a748dfefc68e3905e8fdf17e0484844383 Author: Zhenlei Huang AuthorDate: 2023-10-12 10:14:49 +0000 Commit: Zhenlei Huang CommitDate: 2023-10-19 14:00:57 +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 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42138 (cherry picked from commit a55fbda874db31b804490567c69502c891b6ff61) --- 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++) {