Re: remove __read_mostly?

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

 



On Sun, 25 Jun 2006, Andrew Morton wrote:

> I'm thinking we should remove __read_mostly.
> 
> Because if we use this everywhere where it's supposed to be used, we end up
> with .bss and .data 100% populated with write-often variables, packed
> closely together.  The cachelines will really flying around.

What we really want is a write-often variable in a cacheline combined with 
infrequently read and write data. However, data that is frequently read 
(that is __read_mostly) would still need to be in a separate section.

> IOW: __read_mostly optimises read-mostly variables and pessimises
> write-often variables.
> 
> We want something which optimises both read-mostly and write-often storage.
>  We do that by marking the write-often variables with
> __cacheline_aligned_in_smp.
> 
> OK?

I think we would want to group write-often variables with infrequently 
used variable. But how does one convince the linker to doing that?

I agree that there is a problem with shift frequently written variables 
together which may in itself cause ill effects. So __read_mostly should 
only be used when we have identified real cacheline sharing problems and 
real cache hot variables may have to be put in a separate cacheline for 
itself. I think we already do that and that is at least the way I have 
handled it. Too many __read_mostly kill the whole point of the exercise.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux