In kernel code the macros likely() and unlikely() are frequently
used.Would you please tell me wht those macros will actually perform?.
used.Would you please tell me wht those macros will actually perform?.
likely and unlikely is a call to __builtin_expect which instructs the compiler to generate efficient
favouring the most expected result. As an example consider the code fragment,
if(likely(var)) /* will indicate to compiler most of the time the value of var is such that we fall to call ifunc and thus generate code that optimizes this criteria */
iffunc();
else
efunc();
Thayumanavar S.
On 8/30/05, raja <vnagaraju@xxxxxxxxxxxx> wrote:
Hi,
In kernel code the macros likely() and unlikely() are frequently
used.Would you please tell me wht those macros will actually perform?.
thanking you,
raja
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/