Page MenuHomeFreeBSD

Convert tests of panicstr to KERNEL_PANICKED().
Needs RevisionPublic

Authored by tmunro on Oct 16 2018, 11:04 AM.

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
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

tmunro created this revision.Oct 16 2018, 11:04 AM
tmunro updated this revision to Diff 49244.Oct 16 2018, 11:43 PM

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)

allanjude accepted this revision.Oct 17 2018, 4:38 AM

Approved By: allanjude

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