The CPU has an instruction cache (it reaches out to memory for the series of instructions and grabs a whole bunch at once to be more efficient). When there's a branch (logically, an if statement, a loop, or a goto, or a switch) it has to make a decision about whether or not it should cache the instructions in the if statement or the instructions following the if statement.
Within the linux kernel the macros likely and unlikely are defined so that you can have code of the style
if(likely(x > 10)) {
/* These instructions, which probably will be executed,
* will be cached
*/
}
if(unlikely(ptr == NULL)) {
/* These instructions, which probably won't need to be
* executed, will not be cached
*/
}
Within the linux kernel the macros likely and unlikely are defined so that you can have code of the style