Page MenuHomeFreeBSD

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

Authored by olce on Wed, Apr 23, 10:05 AM.
Tags
None
Referenced Files
F115992521: D49974.diff
Thu, May 1, 7:57 AM
Unknown Object (File)
Mon, Apr 28, 4:39 PM
Unknown Object (File)
Thu, Apr 24, 9:41 PM
Unknown Object (File)
Thu, Apr 24, 12:12 PM
Unknown Object (File)
Thu, Apr 24, 3:04 AM
Unknown Object (File)
Wed, Apr 23, 11:35 PM
Unknown Object (File)
Wed, Apr 23, 9:09 PM
Unknown Object (File)
Wed, Apr 23, 8:43 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.