From nobody Wed May 21 10:08:31 2025 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 4b2Rvg3JzPz5x8pm; Wed, 21 May 2025 10:08:31 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4b2Rvg2B6lz3DRG; Wed, 21 May 2025 10:08:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747822111; 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=DnZnrBzqVztaPyPox3uUVQc/ehHg+U0SanNf1xZdVRc=; b=MzznQ6BGYT5Zu2bxjaU9Jei+vUgFl/fBqsy7nyNOIPVUI/QMURO9znuNsXfqxzsD4HWt31 WI1pEvrDFZyLKgnhYkSNg37qJn1A7G7GzfrfthjXlXsqcw9ztLNhM8XXhw3TzoJySsO4zA fidJ490Z+/4jQNJuUcQhsCXBSbFiYMEIbzxVZMkhGi+l7qe8YWIs685J8kxQypZG6LmdxX cmgFquumr1g/ELuarZ804HC0XFV8XuNM6vsB9vLtdNZwpaQwRxKeMe7XI15VvbUfDs3ftj Gu0FEE93k1Qiv6A4ca29u9txaCMOno8oX4cmeVW2yLziAOpRrecJFeuXJ62cfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747822111; 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=DnZnrBzqVztaPyPox3uUVQc/ehHg+U0SanNf1xZdVRc=; b=n7ihK2HUaOVTh+/XluajoanjTtdh4PfBGUNIyTEbgi1SHmdg7zDuzLXubRKy/cDGoUaeLb Tp9LDx0qZR+hpsX7s8mPFeQEJUc5RwfDrZouYCJd00AZN175O/F006zvRlIbPa05M4BjWU /bu+uNJXOtOSBChCU3LGbnzi+IxEj7KrIlUq68Ft9wISyGaefbrdafKzsMMcEWFkVcJ8SG 6aW6HrD+tBhiFiqbRQvHLBMLk3NgJjrMhaa0TmD9/fjwU4hucECp0QKRMDrTMrZVyLut2k LRFXA/gIfpR8CYshhCkFUYd8GZfxT3uNcnC1rL+JenBOepFMgX2qwDDjr79dlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747822111; a=rsa-sha256; cv=none; b=w1zwmdAxyCYMJQtTmxR6H5apaXX1nRGV3Enm4ZmCi88/nRqQRmwXZDz0vnIM1LVN+QJ9gO kR7KMX0tMNTt/ab54RZF4+28sqUNs078I/AcTqmJyAT5RoCJZRLbRsHkY46V7ntVbXa/AJ ZkhChR7VVzb/5OqYFmyXO1hJ6kviV6dDIy9oBUyH2zDpoV7bJTmR5nS7YY9KWZrGTsVEFf KJxgG0nSYZAlflmZCl6rn1PMrAh/dHQtZ33d672ugt5wctDKNJ71J2Anq+YWgIQFywF1ez sFkz382p6ZqgZJq/TC7fYYeTPQaCbJdab0mKZCzjjR+8wUhDUqf5HnvdLoBF0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4b2Rvg1k7LzVY4; Wed, 21 May 2025 10:08:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 54LA8Vf3011830; Wed, 21 May 2025 10:08:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54LA8VDS011827; Wed, 21 May 2025 10:08:31 GMT (envelope-from git) Date: Wed, 21 May 2025 10:08:31 GMT Message-Id: <202505211008.54LA8VDS011827@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 0b4d5c560abe - releng/14.3 - vfs: vntblinit(): Rework comments on the computation of 'kern.maxvnodes' 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.3 X-Git-Reftype: branch X-Git-Commit: 0b4d5c560abe6848d70a488d7cf6ea7fa7897ade Auto-Submitted: auto-generated The branch releng/14.3 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0b4d5c560abe6848d70a488d7cf6ea7fa7897ade commit 0b4d5c560abe6848d70a488d7cf6ea7fa7897ade Author: Olivier Certner AuthorDate: 2025-05-12 11:20:01 +0000 Commit: Olivier Certner CommitDate: 2025-05-21 10:07:45 +0000 vfs: vntblinit(): Rework comments on the computation of 'kern.maxvnodes' Remove the parts that describe what is already in the code formula. Add hints about which of 'physvnodes'/'virtvnodes' takes precedence, and when 'desiredvnodes' becomes smaller than 'maxfiles'. These were both computed analytically and verified experimentally. Reviewed by: kib (older version) MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50310 (cherry picked from commit bf8890c84bacd8b1acebb2cb9a0944b1bb102b68) (cherry picked from commit 5b07152f3ec3eea78958796b45594c5bd96c0bfb) Approved by: re (cperciva) --- sys/kern/vfs_subr.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index a640bede85b9..62ae987a3084 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -722,15 +722,15 @@ vntblinit(void *dummy __unused) int cpu, physvnodes, virtvnodes; /* - * Desiredvnodes is a function of the physical memory size and the - * kernel's heap size. Generally speaking, it scales with the - * physical memory size. The ratio of desiredvnodes to the physical - * memory size is 1:16 until desiredvnodes exceeds 98,304. - * Thereafter, the - * marginal ratio of desiredvnodes to the physical memory size is - * 1:64. However, desiredvnodes is limited by the kernel's heap - * size. The memory required by desiredvnodes vnodes and vm objects - * must not exceed 1/10th of the kernel's heap size. + * 'desiredvnodes' is the minimum of a function of the physical memory + * size and another of the kernel heap size (UMA limit, a portion of the + * KVA). + * + * Currently, on 64-bit platforms, 'desiredvnodes' is set to + * 'virtvnodes' up to a physical memory cutoff of ~1674MB, after which + * 'physvnodes' applies instead. With the current automatic tuning for + * 'maxfiles' (32 files/MB), 'desiredvnodes' becomes smaller than it at + * ~5136MB. */ physvnodes = maxproc + pgtok(vm_cnt.v_page_count) / 64 + 3 * min(98304 * 16, pgtok(vm_cnt.v_page_count)) / 64;