Page MenuHomeFreeBSD

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

Authored by greg_unrelenting.technology on May 8 2021, 10:41 AM.

Details

Reviewers
hselasky
manu
bz
Group Reviewers
linuxkpi
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
R10 FreeBSD src repository
Lint
Lint Skipped
Unit
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.

greg_unrelenting.technology 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.
greg_unrelenting.technology 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