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
Unknown Object (File)
Mon, Jul 6, 1:18 PM
Unknown Object (File)
Mon, Jul 6, 1:49 AM
Unknown Object (File)
Mon, Jul 6, 12:03 AM
Unknown Object (File)
Sun, Jul 5, 7:05 PM
Unknown Object (File)
Sat, Jul 4, 7:08 AM
Unknown Object (File)
Thu, Jul 2, 3:16 AM
Unknown Object (File)
Thu, Jul 2, 3:10 AM
Unknown Object (File)
Tue, Jun 30, 2:38 PM
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 Not Applicable
Unit
Tests Not Applicable

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