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)
Fri, Nov 8, 5:45 AM
Unknown Object (File)
Oct 10 2024, 7:30 AM
Unknown Object (File)
Oct 1 2024, 1:36 PM
Unknown Object (File)
Sep 30 2024, 5:25 PM
Unknown Object (File)
Sep 30 2024, 3:04 AM
Unknown Object (File)
Sep 27 2024, 11:34 PM
Unknown Object (File)
Sep 26 2024, 4:14 PM
Unknown Object (File)
Sep 26 2024, 4:14 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 Not Applicable
Unit
Tests Not Applicable

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