some questions about kernel source

Mulyadi Santosa mulyadi.santosa at gmail.com
Wed Feb 16 04:00:33 EST 2011


Hi :)

On Wed, Feb 16, 2011 at 12:59, Rajat Jain <rajatjain at juniper.net> wrote:
> Hello loody,
>
>> 1. in kernel/trace, I always see "__read_mostly" at the end of
>> parameter is that a compiler optimization parameter?
>
> Yes, it is a hint to the compiler that the parameter is mostly read, thus if the compiler has to make a decision between optimizing one of the read / write paths, it will optimize the read path even at the expense of write path.


To be precise, they will be grouped into same cache line as much as
possible. By doing so, those cache line won't be invalidated so often
(keeping them "hot" :) hehehhe )

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com



More information about the Kernelnewbies mailing list