From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Shawn Anastasio <sanastasio@raptorengineering.com>,
Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Jan Beulich" <JBeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Julien Grall" <julien@xen.org>,
"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Michal Orzel" <michal.orzel@amd.com>,
"Oleksii Kurochko" <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH for-4.19] xen/arch: Centralise __read_mostly and __ro_after_init
Date: Thu, 20 Jun 2024 18:25:03 +0100 [thread overview]
Message-ID: <3574b89c-d13e-4624-9fd9-4ff641eee80e@citrix.com> (raw)
In-Reply-To: <0460ce5d-0fcc-4f9d-9548-6e86bfb8bc4b@raptorengineering.com>
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 <andrew.cooper3@citrix.com>
> 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 <sanastasio@raptorengineering.com>
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
prev parent reply other threads:[~2024-06-20 17:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-14 12:49 [PATCH for-4.19] xen/arch: Centralise __read_mostly and __ro_after_init Andrew Cooper
2024-06-14 13:39 ` Jan Beulich
2024-06-14 13:51 ` Roger Pau Monné
2024-06-18 23:11 ` Stefano Stabellini
2024-06-14 14:55 ` Oleksii K.
2024-06-20 17:22 ` Shawn Anastasio
2024-06-20 17:25 ` Andrew Cooper [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3574b89c-d13e-4624-9fd9-4ff641eee80e@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=bertrand.marquis@arm.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=oleksii.kurochko@gmail.com \
--cc=roger.pau@citrix.com \
--cc=sanastasio@raptorengineering.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.