From nobody Thu May 15 14:28:05 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 4Zysxz1HmGz5wQlW; Thu, 15 May 2025 14:28:07 +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 4Zysxy15Zvz3fQy; Thu, 15 May 2025 14:28:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747319286; 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=cV3Slr97C1rgs1ZRI4aNTU5iXY9f5jRWQ7N5YI9mOks=; b=xTQUsTQ883N6a7Q5zcZL+kb/5xwPMXdx0sK7by2QCYdd97mfYbK2zXrVJi8/qfR6ZcNF/M 5dbGdmbsa0XsEY9p12iKicx8xgkd5ek2OXEHKPA56D/WrJU7QML4nICaIO9MSfV97LtG76 Gu4+FB5kPO42dOwAiWN0UdcpRUur43ilU53jl2oz3yZDov2xaUWEYgySwnBzkCiLpSNzTO wKwyu1NQChEtdSNoBeUz91Tpf1fkV186XdquuQuIfT+9dYCyn8iRcI/o9O/V/M/5jdR3qs F2G3DMwLPSymrIIlwyxP4an1zQwh3n+LwOZH4eFde4YrxAgaE5bAnUtSG+RQYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747319286; 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=cV3Slr97C1rgs1ZRI4aNTU5iXY9f5jRWQ7N5YI9mOks=; b=xzjY4tkQxItqpYq27VCP6DnhaC+V0DffREhoyD4xaWsfG1mz2vog4qihniUBZKQsuJaG+K Hz4kj6+2G/JaZoOTzTj+pXrOrawwPmrN1Nk89eSdwnlXThIOgfmvbuElN0R1ZIv4COhaIH cCFfS9D2KsA3rHZjMN2L4B9KdTAx8gBm9nsd+w8A5W2Rd+0+4rqjiyT5FpeUIdZPrdCBHP Zk1RoNM0U0uYWrJNkftK0ADKePivqUjM5DRtLJZFQpD1RNvLqeYRx302L3OQTbPDFcr8rI mkh3NQJMaD2H5hYv6ZRLweYqmbtMUBjljPVQ8QJfL3brwHeKAjYvWSdQSPly+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747319286; a=rsa-sha256; cv=none; b=oJ80kG4G8YjwDslOrOLK/5spUYDI46t9Slx54DLxaSitihSh5v3CLt8VC+ktopqMNwd7Wo SyEYZP1fljHNJ1L7OFY5ux2eaTCh/BaUQ8ofmilcnPf4UBMopKY/AX7D10irGOYm4FNClg cj9FdmDcj11o7iMl3Zapba1raSKFf+O9RXZ1N+lOndqxFRmIWWqpL7QHSsfZUT81swCGLZ hEUi8oj139XioXcaXTAz8g/WmIgxfqsfuPflP2YffIWoRD6WxplfwwVWlU8RxLQQTh39b+ wiTqFEU+PjcyciThlJ5C1wkUnU75R3bgZpvgpr4VsZ3gJ0aRix4/zkdt4Jt0/w== 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 4Zysxy0TrLz6D3; Thu, 15 May 2025 14:28:06 +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 54FES5aU059322; Thu, 15 May 2025 14:28:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54FES5ov059319; Thu, 15 May 2025 14:28:05 GMT (envelope-from git) Date: Thu, 15 May 2025 14:28:05 GMT Message-Id: <202505151428.54FES5ov059319@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: bf8890c84bac - main - 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/main X-Git-Reftype: branch X-Git-Commit: bf8890c84bacd8b1acebb2cb9a0944b1bb102b68 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=bf8890c84bacd8b1acebb2cb9a0944b1bb102b68 commit bf8890c84bacd8b1acebb2cb9a0944b1bb102b68 Author: Olivier Certner AuthorDate: 2025-05-12 11:20:01 +0000 Commit: Olivier Certner CommitDate: 2025-05-15 14:27:42 +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 --- 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 5fdd4b6c2474..769586ad0d6b 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -757,15 +757,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;