Re: [PATCH] Move some variables into the "most_readonly" section??

From: Andi Kleen
Date: Wed Jun 08 2005 - 08:19:48 EST


On Tue, Jun 07, 2005 at 12:58:38PM -0700, christoph wrote:
> These variables cause false sharing in some circumstances. However, they
> are just small pointers and 4 byte ints. So this patch would result in
> some wastage of memory since each of those pointers then would occupy a
> whole cache line.
>
> Do we have any provisions for this situation? Or do we need a new section
> for mostly_readonly?


You lost me - when the variable is in the mostly readonly section then
there should not be any false sharing because all the data on these
cache lines should be always in SHARED state. And there is no wasted
memory because the variables can be packed tightly there.

However this means __cacheline_aligned_mostly_readonly doesnt make much
sense since there is no need for alignment in read only. How about
replacing it with a __mostly_readonly that doesnt align and remove
__cacheline_aligned_mostly_readonly?

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/