On 14.06.2024 14:49, 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.

I don't particularly mind this approach, so ...

> Signed-off-by: Andrew Cooper <[email protected]>

Acked-by: Jan Beulich <[email protected]>

Yet this (or variants thereof) is precisely what I wouldn't have wanted to do
myself, for leaving garbled state and, if I'm not mistaken, introducing new
Misra violations because of the redundant #define-s.

Jan

Reply via email to