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] core-parking: shrink and relocate core_parking_cpunum[]
Date: Fri, 6 Mar 2026 15:20:03 +0100	[thread overview]
Message-ID: <aarik2Zlgxc6-Ffp@macbook.local> (raw)
In-Reply-To: <af03f611-ef38-49d0-ac7b-4bad39db46c1@suse.com>

On Wed, Nov 12, 2025 at 04:38:13PM +0100, Jan Beulich wrote:
> This NR_CPUS-dimensioned array is likely unused on most installations.
> Therefore it is especially wasteful for it to consume more space than
> really needed. Use the smallest possible type.
> 
> Further the array having all fields set to -1 is actually useless. Nothing
> relies on it, and core_parking_remove() doesn't restore the sentinel for
> vacated slots. Drop the initializers, moving the array to .bss.
> 
> Finally take the opportunity and update an adjacent variable's type, where
> a fixed-width type was pretty clearly inappropriate to use.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> I assume there is a reason this is acting (mostly) as a LIFO. Else a
> simple cpumask_t would suffice.
> 
> An alternative would be to use the new BRK allocator, at least for NR_CPUS
> above a certain threshold.

Can't we just allocate this memory using xvzalloc_array()?  If we do
care about it being too big certainly allocating only when needed, and
based on the number of possible CPUs on the system would be much
better than playing games with the array type?

Thanks, Roger.


  reply	other threads:[~2026-03-06 14:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-12 15:38 [PATCH] core-parking: shrink and relocate core_parking_cpunum[] Jan Beulich
2026-03-06 14:20 ` Roger Pau Monné [this message]
2026-03-09  8:01   ` Jan Beulich
2026-03-09  9:21     ` Roger Pau Monné

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=aarik2Zlgxc6-Ffp@macbook.local \
    --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.