Page MenuHomeFreeBSD

linuxkpi: add sysctl to suppress WARN_ON stack traces, defaulting to off
ClosedPublic

Authored by val_packett.cool on May 8 2021, 10:41 AM.
Referenced Files
Unknown Object (File)
Dec 20 2023, 2:54 AM
Unknown Object (File)
Dec 12 2023, 2:00 PM
Unknown Object (File)
Dec 3 2023, 10:25 AM
Unknown Object (File)
Nov 23 2023, 3:55 PM
Unknown Object (File)
Nov 12 2023, 6:56 AM
Unknown Object (File)
Nov 10 2023, 3:13 PM
Unknown Object (File)
Nov 8 2023, 10:27 AM
Unknown Object (File)
Nov 6 2023, 9:01 PM

Details

Summary

Prompted by GPU drivers tripping various (mostly locking) warnings when VT switching on panic. When these warnings have stack traces, the msgbuf becomes quite confusing, people would often show these warning traces instead of the real panic trace.

While here, reformat to avoid mixing tabs and spaces for indentation.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This revision is now accepted and ready to land.May 8 2021, 3:25 PM

I wonder if we should have a sysctl to enable warning stack dumps, e.g. from subr_witness.c

#if defined(DDB) || defined(KDB)
/*
 * When DDB or KDB is enabled and witness_trace is 1, it will cause the system
 * to print a stack trace:
 *      - a lock hierarchy violation occurs
 *      - locks are held when going to sleep.
 */
int     witness_trace = 1;
SYSCTL_INT(_debug_witness, OID_AUTO, trace, CTLFLAG_RWTUN, &witness_trace, 0, "");
#endif /* DDB || KDB */

Personally, I would support a sysctl for enabling these warning traces, as they could still be useful debugging tools in the right hands.

Personally, I would support a sysctl for enabling these warning traces, as they could still be useful debugging tools in the right hands.

If we add a sysctl for those *in general* as @emaste proposes, yes, sure.
But this patch just filters out those that happen after a panic. (I can't really imagine any warning when a panic has already happened being helpful.)

I guess we could just do that sysctl, and not filter — if the sysctl would be off by default it would still prevent most of the confusion with after-panic traces.

val_packett.cool retitled this revision from linuxkpi: don't print stack traces in WARN_ON when panicking to linuxkpi: add sysctl to suppress WARN_ON stack traces, defaulting to off.
val_packett.cool edited the summary of this revision. (Show Details)
This revision now requires review to proceed.May 11 2021, 10:20 PM

Apologies; it appears I misread @emaste 's message. Yes, a general sysctl seems like a good idea. Apologies for any confusion.

This revision is now accepted and ready to land.May 12 2021, 7:45 AM