Re: [PATCH] Cpuset: rcu optimization of page alloc hook

Eric Dumazet
2005-12-12T09:07:40Z

Nick Piggin a écrit :
> Eric Dumazet wrote:
>
>> Paul Jackson a écrit :
>>
>>> +
>>> +static kmem_cache_t *cpuset_cache;
>>> +
>>
>>
>>
>> Hi Paul
>>
>> Please do use __read_mostly for new kmem_cache :
>>
>> static kmem_cache_t *cpuset_cache __read_mostly;
>>
>> If not, the pointer can sit in the midle of a highly modified cache
>> line, and multiple CPUS will have memory cache misses to access the
>> cpuset_cache, while slab code/data layout itself is very NUMA/SMP
>> friendly.
>>
>
> Is it a good idea for all kmem_cache_t? If so, can we move
> __read_mostly to the type definition?
>
>

Well this question was already asked.

You cannot move __read_mostly to the type itself as some kmem_cache_t are
included in some data structures.

struct {
...
kmem_cache_t *slab;
...
};

And in this case you cannot automatically add __read_mostly

Eric