Re: some questions about kernel source

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

 



Hi :)

On Wed, Feb 16, 2011 at 12:59, Rajat Jain <rajatjain@xxxxxxxxxxx> 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

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[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