[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] core-parking: shrink and relocate core_parking_cpunum[]


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 6 Mar 2026 15:20:03 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2EU4qSkvZhAQNhEkyrOIgureEUnebpHF+nXMaNnoQdY=; b=VGKs6eNGrOu8ffdBin/J65Yms4uy6/d2P5NySTXzcUdrF0IgSTVqzlq24o/cjiX4i8A9Ho9Wdy4oECFUOAna+oJ2xRcBMk6vC7zRIz41Xu9Kd4cJweBUCeqQvg12GypIKn7AaakfsPUYkP4VW3o7aWmGXKZOQl8zc7sp/N0dwQCxolrFlqrC3qMR6nX2ihWQtQDXitRZ84bkWueidrMyvoUFH8j8hX1eegw8MOEZB9vrUBVvp/0zz8P3Usr+a3lmVNFTseUQqE7+UnlWYdIaI+tzTn50Cf2pJKyFZzUfSzSAs7HFi1WU4J+Ipeq32wX3weLvKcRNu6loaovkimczPw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HyDyyH3UZz3LLNqtdQFrTZGfKRQSQPYdRjWToHF/2ILjBPrB4NQFkbLkuoU1UmKG7Ln4oFqDEC/ELmBXLR+n2vRsAwLhIKoSiov9U9MkzxiEfwCSUD52HmryQKCLKTKhcLuEH4xPviAS6UZltxtUWXgcotujLwmcaBofoEuSn7kV1EaeomJrnWxA/Hc8caHPvioTz8L4tf28E87gbxAVWtLVS9OrqYMOqLLBJhuFR47rgZtl2q8ApEZ08K5FfUtLuqqXbQN/maPF2xdeDHmRmQkwAqxKmJozSNmj9QjxmY/a+zI5Bvg2l1mJJ6mPFqerfCyYVkqdkYtkq0w8NFmRTQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Fri, 06 Mar 2026 14:22:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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@xxxxxxxx>
> ---
> 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.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.