ache miss in that path is just fine. The usage of likely is more rare, and some usages are just cargo-cult. Here you could use it, as the hot path is definitely the if leg. But if you look at the generated code, it most likely doesn't make any difference, because gcc is smart enough to handle it. A problem arises when likely/unlikely are used improperly, or the code changes and the frequency when each leg is taken changes. Now the likely/unlikely is introducing mispredictions the compiler could have avoided and harming performance. I wasn't gonna comment in the review, since the likely() seems harmless in your patch. But what got my attention was that each separate expression was under a single likely() expression. I don't think that makes much sense, since the hint is useful for the placement of the if/else legs, it should encompass the whole condition. That's how it is used almost anywhere else in the kernel (there are a few occurrences drivers/scsi/ that also look a bit fishy, IMO). -- Gabriel Krisman Bertazi[PATCH v3 06/25] io_uring/kbuf: add buffer ring pinning/unpinningGabriel Krisman Bertazi undefinedJoanne Koong undefined undefined undefined undefined undefined undefined undefined undefined undefined‚J„ĺQ