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
F103304105: D19007.diff
Sat, Nov 23, 7:39 AM
Unknown Object (File)
Sat, Nov 16, 6:14 AM
Unknown Object (File)
Oct 7 2024, 6:31 PM
Unknown Object (File)
Oct 4 2024, 6:23 PM
Unknown Object (File)
Oct 4 2024, 7:56 AM
Unknown Object (File)
Oct 2 2024, 4:29 AM
Unknown Object (File)
Oct 2 2024, 12:14 AM
Unknown Object (File)
Oct 1 2024, 10:59 PM

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 23264
Build 22299: 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.

205–206

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.

222

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.