From nobody Tue May 20 09:08:39 2025 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 4b1pd40Xhfz5w4c4; Tue, 20 May 2025 09:08:40 +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 4b1pd35Wtbz43FY; Tue, 20 May 2025 09:08:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747732119; 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=T5VRxaU7V5oLehxlEn33++Z0ozgAih6LckM6BdiO40w=; b=UpFoCB9TQXUmGDEvc7FMJSciK2cOY5igmbHgsOagtkRsuq/XX90eGrbjAAjhDI3zzihIkT x9tHyUYfwfJkfqsxT/x8b/lYx48oIh5vUPf6wByZohcDu3H8ogMTdDmt6l2yGoTnCUIIeJ Nj36HBJmUvCkrSD0XShYETe7DjgJNrqD3GbgB1qPjaBiL8rQNabrbxXq2NdH2jrQjo66wS Y4DE6f1/aUcJDEldPWvwQl2A2bSIgSEW/TAV6afD3/QYxib0P8EwnbxLzoVhwxdlOlUgJA 9U2K+65u6jaMq5r4kf/kqDzL7q2w/gH6U1l8soC2Ijg8hUkszFg6tJkT799h5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747732119; 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=T5VRxaU7V5oLehxlEn33++Z0ozgAih6LckM6BdiO40w=; b=je4BLPfJa9stZBYyV8N5uu57nMw14RVrs1JBdBX3CnOlzwFzR4DyAPsq44EXjSAZ23pk6p riEKkvpfpLpcjX4IU8L9og8NRWY1c55rEoCtZ2QXrxt10qCLDAPhs4cplmVlvy4GJQxbtJ 7XhLi7Bp0MeIsS/amfmHn4UfYQEizMrudiDIFfmA6mL6KCre7x77d14apFHgqfcvv7Xvqf hFygWO9kt85s3NgwKNSbILgyktwEs7d4/RQwU1Lm4qhR26xEgTtG5raPwyr3r0wgd8j2D1 rPNXS4MRrPMNLQoO5xXfmRtKazeGvv3flAcTQaJfP0kVIOXyutDEg6vLN49TZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747732119; a=rsa-sha256; cv=none; b=QPsBkQivkX+maez3SDFC9Tl0T1O0JkVcRQCG5ejhWNjgo76A73WuAATrf7hvHFYOpGZrEu Y3fOB4RjyCejpGI58539oKRRuJdjZBmbbtlVq+7xCwBPMMWH0qWuiD2go1ZDSb7K4HcMEd HrmbTwSrmwGngH9lB3UVGWw57OwtKE5E54mZqYThQcZhXHZ8mwwqA5scTCG8UZp1wDMNX3 bJ1QbVcFYni6yXwzD0hT7v32YYnqHLaz4QPOVqkSsbDtR1tYzKIOPd39cFrp5lo8ovwue0 +TxIguMBG/7hZsNhg6sgX7ZU9nCXqTFTdkkzIpZC+WP8gl6sGtR/lO+osNYheQ== 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 4b1pd343nFzkHY; Tue, 20 May 2025 09:08:39 +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 54K98dvY000848; Tue, 20 May 2025 09:08:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54K98d13000845; Tue, 20 May 2025 09:08:39 GMT (envelope-from git) Date: Tue, 20 May 2025 09:08:39 GMT Message-Id: <202505200908.54K98d13000845@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: 5b07152f3ec3 - stable/14 - vfs: vntblinit(): Rework comments on the computation of 'kern.maxvnodes' 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 5b07152f3ec3eea78958796b45594c5bd96c0bfb Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=5b07152f3ec3eea78958796b45594c5bd96c0bfb commit 5b07152f3ec3eea78958796b45594c5bd96c0bfb Author: Olivier Certner AuthorDate: 2025-05-12 11:20:01 +0000 Commit: Olivier Certner CommitDate: 2025-05-20 09:05:33 +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) --- 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;