Page MenuHomeFreeBSD

Convert tests of panicstr to KERNEL_PANICKED().
AbandonedPublic

Authored by tmunro on Oct 16 2018, 11:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 19, 7:30 PM
Unknown Object (File)
Sat, Jan 18, 5:24 PM
Unknown Object (File)
Dec 26 2024, 10:40 AM
Unknown Object (File)
Nov 26 2024, 8:22 AM
Unknown Object (File)
Nov 20 2024, 10:18 AM
Unknown Object (File)
Nov 14 2024, 4:42 PM
Unknown Object (File)
Oct 3 2024, 5:10 AM
Unknown Object (File)
Oct 2 2024, 8:15 AM
Subscribers

Details

Reviewers
mjg
allanjude
Summary

Many code paths check if the kernel has panicked by accessing
panicstr. Change them all to use a new function-like macro
KERNEL_PANICKED(). This lets us use __predict_false()
consistently, and lets us make further changes to the way the
condition is detected in future.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Here's a better version (the last one had an unintended stray change).
Note: this is a refactoring suggested by mjg, to support his future plans to change the representation of panic state to something small in __read_frequently. The new macro will hide those details from all these call sites, though for now it just does what it was doing before (with the addition of the prediction).

Future note: please upload patches with full context, either using the 'arcanist' tool, or just generate the diff with -U99999 (svn diff -x -U99999)

This revision is now accepted and ready to land.Oct 17 2018, 4:38 AM
mjg requested changes to this revision.Oct 20 2018, 2:59 AM

with this patch applied git grep panicstr still reveals entries in cddl/ code. it should also get modified or the boolean switch is not going to work.

This revision now requires changes to proceed.Oct 20 2018, 2:59 AM

Discussed with Mateusz, he would prefer to write a Coccinelle script to automate this change, so I am abandoning this patch.