Page MenuHomeFreeBSD

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

Authored by olce on Apr 23 2025, 10:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 1, 7:22 PM
Unknown Object (File)
Fri, Jun 27, 2:19 AM
Unknown Object (File)
Wed, Jun 25, 9:35 AM
Unknown Object (File)
Tue, Jun 24, 12:06 AM
Unknown Object (File)
Mon, Jun 23, 7:48 AM
Unknown Object (File)
Sat, Jun 21, 10:43 PM
Unknown Object (File)
Fri, Jun 20, 9:04 AM
Unknown Object (File)
Thu, Jun 19, 6:17 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.Apr 23 2025, 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.Apr 23 2025, 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.