On 20/06/2024 6:22 pm, Shawn Anastasio wrote:
> On 6/14/24 7:49 AM, Andrew Cooper wrote:
>> These being in cache.h is inherited from Linux, but is an inappropriate
>> location to live.
>>
>> __read_mostly is an optimisation related to data placement in order to avoid
>> having shared data in cachelines that are likely to be written to, but it
>> really is just a section of the linked image separating data by usage
>> patterns; it has nothing to do with cache sizes or flushing logic.
>>
>> Worse, __ro_after_init was only in xen/cache.h because __read_mostly was in
>> arch/cache.h, and has literally nothing whatsoever to do with caches.
>>
>> Move the definitions into xen/sections.h, which in paritcular means that
>> RISC-V doesn't need to repeat the problematic pattern.  Take the opportunity
>> to provide a short descriptions of what these are used for.
>>
>> For now, leave TODO comments next to the other identical definitions.  It
>> turns out that unpicking cache.h is more complicated than it appears because 
>> a
>> number of files use it for transitive dependencies.
>>
>> Signed-off-by: Andrew Cooper <[email protected]>
> This seems like a reasonable approach, and removing usage of the old
> cache.h __read_mostly from the PPC tree should be a relatively simple
> follow up patch from my end.
>
> Acked-by: Shawn Anastasio <[email protected]>

Thanks.

And funnily enough, I have a patch doing that which I'm just about to
post, because RISC-V needs exactly the same treatment.  x86 and ARM are
a different story.

~Andrew

Reply via email to