Page MenuHomeFreeBSD

Add descriptions for sysctls in kern_mib.c which lack them.
ClosedPublic

Authored by rpokala on Jan 28 2019, 9:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 11 2024, 5:10 AM
Unknown Object (File)
Jan 25 2024, 2:08 AM
Unknown Object (File)
Jan 25 2024, 2:08 AM
Unknown Object (File)
Jan 25 2024, 2:08 AM
Unknown Object (File)
Dec 23 2023, 1:59 AM
Unknown Object (File)
Dec 20 2023, 1:06 AM
Unknown Object (File)
Dec 11 2023, 2:48 AM
Unknown Object (File)
Dec 7 2023, 8:09 AM

Details

Summary

r343532 noted the difference between "hw.realmem" and "hw.physmem", which I
was previously unaware of. I discovered that neither sysctl had a description
visible via sysctl -d, so I found where they were defined and added
suitable descriptions. While in the file, I went ahead and added descriptions
for all the others which lacked them.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22289
Build 21481: arc lint + arc unit

Event Timeline

This is a step in the right direction. I appreciate the units are mentioned explicitly.

kib added inline comments.
sys/kern/kern_mib.c
192

modules, not drivers.

That said, also the dcons buffer, if any, is not accounted for, on x86.

206–208

Realmem is in fact silly and often not reliable.

It is the amount of memory reported by bios. which is often does not have any resemblance to the reality. If system somehow detects this, it reports the max memory address as the hw.realmem.

224

Again, this is not true. It is the difference between physmem (see above) and the size of wired memory. Many of kernel allocations do not wire underlying pages. Some user allocations are wired.

Update descriptions based on Kostik's feedback.

Thanks for the feedback, @kib; take another look?

I do not like it. The sysctl descriptions are supposed to be single-line and perhaps even shorter, now it looks like the paragraph from a man page.

So I propose to move the new text to the sysctl(3) manpage where it belongs. Instead, single-liners from sysctl(3) might be used for the sysctl description lines.

sys/kern/kern_mib.c
192

dcons buffer is accounted on x86.

As suggested, simplified the descriptions and added a pointer to the manpage.

OK from manpages. Thanks for doing the work.

This revision is now accepted and ready to land.Mar 23 2019, 3:46 AM
sys/kern/kern_mib.c
191

'; see sysctl(3)' is redundand, why kernel should lecture users how to use man(1) ? We do not do things like 'No such file or directory, see open(2)'.

Remove the reference to sysctl(3) from the individual descriptions.

This revision now requires review to proceed.Mar 23 2019, 6:36 PM
This revision is now accepted and ready to land.Mar 23 2019, 6:44 PM
This revision was automatically updated to reflect the committed changes.