From nobody Mon Mar 23 20:22:17 2026 X-Original-To: dev-commits-src-main@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 4ffl2f2mg7z6WSvM for ; Mon, 23 Mar 2026 20:22:18 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ffl2d5gkXz3VGy for ; Mon, 23 Mar 2026 20:22:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1774297337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qJy4Gt4pEK8J0VywH8h6jxae38PiNkzqcGo5cBzyCWg=; b=GfbJaFWWpyqft6uwRqSdbxWoVoKx3nMt29/86rgjBGc19G83wyOPGRYeGk/n9XrBA9nRka dCgMHwbV9rS4NBqigs4FbRfDoQvbyR1A71JQXVDcVdUrwoSLEl0muV39jiTRQKC8qsvDKb AVd8ygLLLJbptq/MO/tIny1b38bMaANBLGTK9go11c7wyNPEzge73fqlW960cTdvyhlTaY AYdmBpbYWv96ljCeiJhTf3w+RBTTSx7cwyZhXPAc7t28FSXKW6/h3d5bdALcl1iVqwpJAN fXdHyTpvmLu6keZCnIUh9A64FSep+7ZnbKm5DEeZ9xOfZSsh7xB/TfMH2oDzyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1774297337; a=rsa-sha256; cv=none; b=w0nUAsFLifZpRAFAiRSRuX2rAUWO7yT5TtDTd+Nxs+s2p4adN55AM9iedOmA3BxPQJ5QWJ 5uEt25VYLxu96jFAfu7sxgJtlG6zeNCB2gwaQyc44Jwm27+VYK8KZciT9Z2fAwkBaR8Ifx eNKjJtT4BXg2SR/LC1aPWk1W1qVvEZHzoxGFbsbIyPzlbL4Wb+vJNQdcoWk7pvCtFiKtVp VzrAbiJ3VPifyYpMCUbjnu5OlE3NS35fiQIizbzk6c1iCad/qyesxZdTUwNGAWvQ3euu+q nbQU9+Z7KunWA/DuIe5YFs7aZNc896tBM8S7n3o2NGPDNf3cDcsAzUZEAoul5Q== 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=1774297337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qJy4Gt4pEK8J0VywH8h6jxae38PiNkzqcGo5cBzyCWg=; b=HUyeci7Nfsm2s1115m1n5JjU9xYWVQYqWaZHx7tGnzg8e2BDT/egdo16vcvu958meIlgT/ ZbhvsFV6GQRFEjh73qAN9eLR3CTqRaH48u0wYi6q7K0jJlBAIkNVx5cn61rNQN9G45QBWQ K1wo/q4l/4TmKhTPTFK6+McuxJ6aualu1qFwi0UbEXWxHCziyci9zpgzVyuppYKpRLP0CL AFsHf/ltN3vQQgsMsnamVeaNC/u+xFRp74vBXKwQlSdtK4RVzd2QxcucS+ZxxNHsY835YT OfyeCrE5J6fGi9AY835LjIGP/JJ7/qGVoANXfiLvAIDLE/7pvPoQym07bM9ogg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ffl2d4JhFz13X0 for ; Mon, 23 Mar 2026 20:22:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47232 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 23 Mar 2026 20:22:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Paulo Fragoso From: Mitchell Horne Subject: git: 2318ea10a3af - main - hwpmc.4: correct stale default values and update diagnostics List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2318ea10a3afb66c51078483f74c1a622811a619 Auto-Submitted: auto-generated Date: Mon, 23 Mar 2026 20:22:17 +0000 Message-Id: <69c1a0f9.47232.5528270a@gitrepo.freebsd.org> The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=2318ea10a3afb66c51078483f74c1a622811a619 commit 2318ea10a3afb66c51078483f74c1a622811a619 Author: Paulo Fragoso AuthorDate: 2026-03-23 20:17:54 +0000 Commit: Mitchell Horne CommitDate: 2026-03-23 20:21:28 +0000 hwpmc.4: correct stale default values and update diagnostics The default values documented for kern.hwpmc.logbuffersize (4KB) and kern.hwpmc.nbuffers_pcpu (64) have been incorrect since 2981a3420cb1 (2018), which updated the compiled defaults but did not update the man page. - Correct logbuffersize default from 4KB to 256KB, add 16MB maximum - Correct nbuffers_pcpu default from 64 to 32, document 32MB per-CPU product limit with kern.hwpmc.logbuffersize - Update DIAGNOSTICS section to reflect current warning messages Reviewed by: mhorne MFC after: 1 week Sponsored by: NLINK (nlink.com.br) Differential Revision: https://reviews.freebsd.org/D56050 --- share/man/man4/hwpmc.4 | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/share/man/man4/hwpmc.4 b/share/man/man4/hwpmc.4 index 1ab690e5009c..5b3e9a195b8c 100644 --- a/share/man/man4/hwpmc.4 +++ b/share/man/man4/hwpmc.4 @@ -445,7 +445,8 @@ The default is 16. The size in kilobytes of each log buffer used by .Nm Ns 's logging function. -The default buffer size is 4KB. +The default buffer size is 256KB. +The maximum value is 16MB. .It Va kern.hwpmc.mincount Pq integer, read-write The minimum sampling rate for sampling mode PMCs. The default count is 1000 events. @@ -453,10 +454,15 @@ The default count is 1000 events. The size of the spin mutex pool used by the PMC driver. The default is 32. .It Va kern.hwpmc.nbuffers_pcpu Pq integer, read-only -The number of log buffers used by +The number of log buffers per CPU used by .Nm for logging. -The default is 64. +The default is 32. +The product of +.Va kern.hwpmc.nbuffers_pcpu +and +.Va kern.hwpmc.logbuffersize +must not exceed 32MB per CPU. .It Va kern.hwpmc.nsamples Pq integer, read-only The number of entries in the per-CPU ring buffer used during sampling. The default is 512. @@ -522,16 +528,23 @@ was not configured with the required configuration option .It "hwpmc: tunable hashsize=%d must be greater than zero." A negative value was supplied for tunable .Va kern.hwpmc.hashsize . -.It "hwpmc: tunable logbuffersize=%d must be greater than zero." +.It "hwpmc: logbuffersize=%d must be greater than zero and less than or equal to %d, resetting to %d." A negative value was supplied for tunable .Va kern.hwpmc.logbuffersize . -.It "hwpmc: tunable nlogbuffers=%d must be greater than zero." +.It "hwpmc: nbuffers_pcpu=%d must be greater than zero, resetting to %d." A negative value was supplied for tunable -.Va kern.hwpmc.nlogbuffers . +.Va kern.hwpmc.nbuffers_pcpu . .It "hwpmc: tunable nsamples=%d out of range." The value for tunable .Va kern.hwpmc.nsamples was negative or greater than 65535. +.It "hwpmc: nbuffers_pcpu=%d * logbuffersize=%d exceeds %dMB per CPU limit, resetting to defaults (%d * %d)." +The product of tunables +.Va kern.hwpmc.nbuffers_pcpu +and +.Va kern.hwpmc.logbuffersize +exceeds the maximum per-CPU memory limit. +Both tunables are reset to their compiled defaults. .El .Sh DEBUGGING The