Re: __read_mostly

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

 



Yes precisely the same what I see..

Thanks,
Onkar

On Wed, Apr 7, 2010 at 9:16 PM, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx> wrote:
Hi Onkar....

On Wed, Apr 7, 2010 at 17:56, Onkar Mahajan <kern.devel@xxxxxxxxx> wrote:
> static struct hlist_head *inode_hashtable __read_mostly;
>
>
> what is the use of  __read_mostly ?
>
> I did not find any detailed documentation for this
> on GCC  website , Is it GCC optimization feature ?

I failed to search the definition in kernel source or gcc docs.
However, I am pretty confidence that this is somekind of definition to
mark the related variable/structure/whatever and put them into the
same memory segment.

By doing so, the programmers are hoping that these data are grouped
into the same cache line. And since they are mostly read only, cache
won't be invalidated too much (maybe zero in some cases) if there is
update into that cache line.

Does this clear your doubt?

--
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

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


[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