Page MenuHomeFreeBSD

witness: actually set read-only tunables in time for witness_startup
ClosedPublic

Authored by rlibby on Tue, Jun 16, 11:19 PM.
Tags
None
Referenced Files
F160309774: D57613.diff
Tue, Jun 23, 3:10 AM
Unknown Object (File)
Mon, Jun 22, 5:26 PM
Unknown Object (File)
Mon, Jun 22, 2:13 AM
Unknown Object (File)
Mon, Jun 22, 1:39 AM
Unknown Object (File)
Sun, Jun 21, 8:11 PM
Unknown Object (File)
Sat, Jun 20, 11:32 PM
Unknown Object (File)
Sat, Jun 20, 11:09 PM
Unknown Object (File)
Fri, Jun 19, 2:01 AM
Subscribers

Details

Summary

SYSCTL_XXX with CTLFLAG_RDTUN and without CTLFLAG_NOFETCH should not be
used for values that are needed before SI_SUB_KLD. Otherwise they are
tuned after they are needed. Set CTLFLAG_RDTUN | CTLFLAG_NOFETCH for
the debug.witness.witness_count and debug.witness.skipspin sysctls and
add separate tunables for them, which run at SI_SUB_TUNABLES time, i.e.,
in time for witness_startup.

Sponsored by: Dell Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 73917
Build 70800: arc lint + arc unit

Event Timeline

So, why mess with the types (int -> bool and int -> u_long)? Strictly speaking it is not necessary and I can revert it if you prefer. I note though that there is no TUNABLE_UINT() and a comment for TUNABLE_INT() suggests not to use it. I don't know why this is, but just converting to bool and u_long seems fine anyway.

So, why mess with the types (int -> bool and int -> u_long)? Strictly speaking it is not necessary and I can revert it if you prefer. I note though that there is no TUNABLE_UINT() and a comment for TUNABLE_INT() suggests not to use it. I don't know why this is, but just converting to bool and u_long seems fine anyway.

Converting to bool is fine IMO. sysctl_handle_bool() provides some backward compatibility for code which assumes the old type. The int -> u_long conversion is not backwards compatible but I can't imagine that it's a problem in this case.

This revision is now accepted and ready to land.Wed, Jun 17, 1:27 PM