From nobody Thu May 15 14:23:30 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 4Zysrf5kbBz5wQkb; Thu, 15 May 2025 14:23:30 +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 4Zysrf54S9z3c6Y; Thu, 15 May 2025 14:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747319010; 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=lXo+bBo21C2AQYejxpILhIvdQM1IkvtsArMPJFKC+Zs=; b=KiMm1WIV1yrFvgbzvR9iIq+yxkqXXhbP8rWIxfiFGKtTykXzYLpMEq6JLKA1731iql+nzF kroGWwWp6WRrToK2pI9Ex/Ey8YFAl2qcCknOj7u2m+Dc0SiW906zpmWDKUxvCY8squlefi I+wkLJeWv3gFEgxZVpEH9tPwqWdS7FCKpxSMGWPmBJ7xgMB3D9r7ayNqzcgVYfCwnVD+Lh gsr+gGnqVUs/PfXJ6hs/6wP6wpNzMIgivoIe6c5n8NKRouiroHjrZiBne+CHYikyBiIQ2b E9hhwHUNZ8ZFhOwGl1Nlek4Jp+GQbN89QxFqBKzGGpSlZY7yXJgdwx19XZpqog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747319010; 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=lXo+bBo21C2AQYejxpILhIvdQM1IkvtsArMPJFKC+Zs=; b=q6wIX7J4CbAmOnvgvdqFKeT0IV1yHfS8IZ82y/Cce2hoL4dUW9hfKANYkjtblFkyCAlqni /1U25yqw/gQ8dpBDn9AGQxSOoj7fEFs2Mj78rNr5ZkwQvPWAfqbKn4mBzi/TfLkmAHU2dt ZhsKMRcW7+9imMK2fzods2k7sz0Uh4JMmIO3xYRYmk23rSjuTaypT/A2DPweO4QdzjzXkX SvB9buamWAhBiM5iLp5dJtvVPMgSB2Ic7zgailBztyCKCgpBnov3zjpMzPys6alghQasm9 K8N2/5qq5bjdgJ2emSSrHGHUYSY+brhXhUG7WFE/ZU4n8b+rCITMyXEuUbCdLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747319010; a=rsa-sha256; cv=none; b=xiNtU+cFQv4X5oHzSzTiVxcpv00cBDybOPj+ygQ1QEWoywJbR03ZIDu2ZYj0LWMPuo0sVa X+aGe/LiwEvUngk/pq7qOjM3buJj43X9KyROUz1aq5BefyWbnmi09xS0FaDZ8O6IgMbR3Z q9v/ov1CUqXbRTqHWSQZiPc1OVytrRMVOQAv6YAHGeuMHPPKDx3ggsZpRBudJls8wkoqJC TdwHQ/o9RNIaBq4cPUHsYmS9OYCjnAm1Fk5nzicSX+tPyI6w4rmyD4uM+BbAmzMuiud4TA PiuD8PBEtAE+S7eEIv+o+zerFxZd16UCgnXT0XjHHAgNL3a7P4F0avrdG5TUvg== 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 4Zysrf4gqZz5vT; Thu, 15 May 2025 14:23:30 +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 54FENUCL057721; Thu, 15 May 2025 14:23:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54FENUmx057718; Thu, 15 May 2025 14:23:30 GMT (envelope-from git) Date: Thu, 15 May 2025 14:23:30 GMT Message-Id: <202505151423.54FENUmx057718@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: 1935cc945642 - 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: 1935cc945642424bb223b570f4be5c4af8e33806 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=1935cc945642424bb223b570f4be5c4af8e33806 commit 1935cc945642424bb223b570f4be5c4af8e33806 Author: Olivier Certner AuthorDate: 2025-05-12 11:20:01 +0000 Commit: Olivier Certner CommitDate: 2025-05-15 14:22:58 +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/D50130 --- 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;