Re: like /unlikely macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Apr 15, 2006 at 03:06:09PM +0100, pushparaj vitekar wrote:

> hi

Hi,

>  can any one explain the likely/unlikely macros 
> what is their purpose ,where they should be used?

they give the compiler a strong hint which code path is likely and which 
not.

This is useful for hot paths in the kernel and for macros like 
BUG_ON() (a bug is unlikely, and if you hit it, performance usually 
isn't your biggest problem).

They are _not_ meant for 51:49 situations.

Usually, you won't need them.

> thanks

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux