Page MenuHomeFreeBSD

witness: add tunables debug.witness.lock_order_{data_count,hash_size}
ClosedPublic

Authored by rlibby on Mon, Jun 15, 4:02 PM.
Tags
None
Referenced Files
F160396192: D57600.id.diff
Wed, Jun 24, 2:25 AM
F160326638: D57600.id179971.diff
Tue, Jun 23, 7:48 AM
F160326625: D57600.id179971.diff
Tue, Jun 23, 7:48 AM
F160326604: D57600.id179971.diff
Tue, Jun 23, 7:48 AM
Unknown Object (File)
Sun, Jun 21, 9:57 PM
Unknown Object (File)
Sun, Jun 21, 8:16 PM
Unknown Object (File)
Fri, Jun 19, 3:54 AM
Unknown Object (File)
Fri, Jun 19, 12:30 AM
Subscribers

Details

Summary

Add tunable debug.witness.lock_order_data_count to allow adjusting the
number of witness lock order data entries (stacks) without recompiling
the kernel. This may help to display stacks when a lock order reversal
is reported but the number of entries is exhausted before recording the
first lock order, by allowing the user to reboot with an adjusted
tunable and try again.

Tunable debug.witness.lock_order_hash_size is also provided to allow the
hash table load factor to be managed, though that is not required.

Also tweak witness_lock_order_add to avoid computing a hash when it
won't be needed because the lock order data entries are exhausted.

Sponsored by: Dell Inc.

Test Plan

Boot new kernel with these set in loader:

set debug.witness.lock_order_data_count 20000
set debug.witness.lock_order_hash_size 8191

examine

sysctl debug.witness

Diff Detail

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

Event Timeline

rlibby added reviewers: markj, glebius, kib.
markj added inline comments.
sys/kern/subr_witness.c
3435

This change isn't required for correctness, right?

This revision is now accepted and ready to land.Mon, Jun 15, 5:19 PM
sys/kern/subr_witness.c
3435

Correct. This would have a very minor performance benefit of avoiding calculating the hash when we're already out of lock order data entries. I can drop it, or move it to another commit, if you prefer.

sys/kern/subr_witness.c
3435

It's fine, I just wasn't sure if I was missing something. I missed the last sentence in the description.

Addressing problems uncovered in testing. I had assumed that the
mechanism used by debug.witness.witness_count actually worked, but it
didn't. I added a new patch D57613 to address the problem with
witness_count by itself, and then applied that fix here too. I also
fixed an alignment problem.

This revision now requires review to proceed.Tue, Jun 16, 11:24 PM
This revision is now accepted and ready to land.Wed, Jun 17, 1:33 PM