Page MenuHomeFreeBSD

Fix a bug with duplicate sysctl names.
ClosedPublic

Authored by jeff on Dec 3 2019, 9:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 10:55 AM
Unknown Object (File)
Fri, Nov 22, 2:22 PM
Unknown Object (File)
Thu, Nov 21, 1:28 PM
Unknown Object (File)
Thu, Nov 21, 11:52 AM
Unknown Object (File)
Wed, Nov 20, 3:36 AM
Unknown Object (File)
Wed, Nov 20, 1:19 AM
Unknown Object (File)
Tue, Nov 19, 10:59 AM
Unknown Object (File)
Tue, Nov 19, 10:50 AM
Subscribers

Details

Summary

Use one greater than the highest observe count. This may inflate the numbers but it will not have duplicates. If you create 4bn zones ordered to inflate the numbers you can deal with the sysctl warnings.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jeff added reviewers: markj, pho, rlibby.
rlibby added inline comments.
sys/vm/uma_core.c
1895–1899 ↗(On Diff #65180)

An alternative might be to make use of snprintf(NULL, 0, fmt, ...); to count. (Or, maybe we ought to provide int asprintf(char **p, struct malloc_type *, const char *fmt, ...).)

This revision is now accepted and ready to land.Dec 3 2019, 11:43 PM