Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Apr 2026 15:28:28 +0000
From:      Mitchell Horne <mhorne@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Cc:        Paulo Fragoso <paulo@nlink.com.br>
Subject:   git: 928091964581 - stable/15 - hwpmc.4: correct stale default values and update diagnostics
Message-ID:  <69e1001c.201f8.c9aa4a@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=9280919645816261823f5c4bc5ec6dd19c072e80

commit 9280919645816261823f5c4bc5ec6dd19c072e80
Author:     Paulo Fragoso <paulo@nlink.com.br>
AuthorDate: 2026-03-23 20:17:54 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2026-04-16 15:18:25 +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
    
    (cherry picked from commit 2318ea10a3afb66c51078483f74c1a622811a619)
---
 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 54a251dcca76..8bb1cb96f694 100644
--- a/share/man/man4/hwpmc.4
+++ b/share/man/man4/hwpmc.4
@@ -441,7 +441,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.
@@ -449,10 +450,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.
@@ -518,16 +524,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


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69e1001c.201f8.c9aa4a>