Page MenuHomeFreeBSD

queue(3): Wrap all QMD_PANIC() guards with __predict_false()
AcceptedPublic

Authored by olce on Wed, Apr 23, 10:05 AM.

Details

Reviewers
markj
emaste
Summary

All these guards are bound to be almost always false (obviously).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 63661
Build 60545: arc lint + arc unit

Event Timeline

olce requested review of this revision.Wed, Apr 23, 10:05 AM

I imagine the compiler might infer this already but I don't think it hurts readability in any significant way, so sure.

This revision is now accepted and ready to land.Wed, Apr 23, 12:23 PM

I imagine the compiler might infer this already but I don't think it hurts readability in any significant way, so sure.

It could (for the regular panic() case, and more generally "noreturn" functions), although there might be cases where the "noreturn" path is actually the most probable, but this is arguably niche and could understandably be ignored by the compiler. Cases where one does not want to actually panic, but just print a diagnostic message and continue, would benefit from this but are likely edge cases. I was not too sure about doing this change, but as you say it doesn't hurt either.