Thanks,
Onkar
On Wed, Apr 7, 2010 at 9:16 PM, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx> wrote:
Hi Onkar....
I failed to search the definition in kernel source or gcc docs.
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 ?
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