All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>
Subject: Re: [PATCH] CPU: abstract read-mostly-ness for per-CPU cpumask_var_t variables
Date: Mon, 2 Feb 2026 17:05:00 +0100	[thread overview]
Message-ID: <aYDLLOunpgoM9KzP@Mac.lan> (raw)
In-Reply-To: <7eed3c7e-b3e8-4a0c-bd6d-c4ba22bb1c10@suse.com>

On Mon, Feb 02, 2026 at 04:59:07PM +0100, Jan Beulich wrote:
> On 02.02.2026 16:50, Roger Pau Monné wrote:
> > On Wed, Nov 12, 2025 at 04:53:27PM +0100, Jan Beulich wrote:
> >> cpumask_var_t can resolve to a pointer or to an array. While the pointer
> >> typically is allocated once for a CPU and then only read (i.e. wants to be
> >> marked read-mostly), the same isn't necessarily true for the array case.
> >> There things depend on how the variable is actually used. cpu_core_mask
> >> and cpu_sibling_mask (which all architectures have inherited from x86,
> >> which in turn is possibly wrong) are altered only as CPUs are brought up
> >> or down, so may remain uniformly read-mostly. Other (x86-only) instances
> >> want to change, to avoid disturbing adjacent read-mostly data.
> >>
> >> While doing the x86 adjustment, also do one in the opposite direction,
> >> i.e. where there was no read-mostly annotation when it is applicable in
> >> the "pointer" case.
> >>
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> > 
> > Acked-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Thanks.
> 
> >> ---
> >> Really in the pointer case it would be nice if the allocations could then
> >> also come from "read-mostly" space.
> > 
> > Hm, I guess for some of them yes, it would make sense to come from
> > __read_mostly space, but would require passing an extra parameter to
> > the DEFINE_ helper? Or introduce another variant.
> 
> Whether this could be sorted purely at the macro wrapper layer I'm not
> sure. It's the actual allocation (which alloc_cpumask_var() et al do)
> which would need to be more sophisticated than a simple _x[mz]alloc().

For the array case it could be sorted out in the macro wrapper - for
the pointer case it would need to be sorted at allocation, which makes
this quite weird to deal with.  Anyway, this is better than nothing I
guess.

Thanks, Roger.


      reply	other threads:[~2026-02-02 16:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-12 15:53 [PATCH] CPU: abstract read-mostly-ness for per-CPU cpumask_var_t variables Jan Beulich
2026-02-02 15:50 ` Roger Pau Monné
2026-02-02 15:59   ` Jan Beulich
2026-02-02 16:05     ` Roger Pau Monné [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=aYDLLOunpgoM9KzP@Mac.lan \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.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.