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

Re: [PATCH for-4.22 5/5] xen/numa: fix setup of non-aligned memory affinity ranges


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 3 Jun 2026 15:52:15 +0200
  • 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=A+TZt0aavyBKq+KPdzXHwK1p5G/y1l89qbb2KxqbgFM=; b=knuAPGsgcau+X4/UMjTFJYS1qutS4dmYDihxVAQvV8mEkfDZyAe/wuMbrAyvSVCtcsA5R4+6rm62BmeCoSRyF4v8NXagWz5JGPeYLk/ghsoPzUklZeSP2Mr+JurstH9aZc96lgjTNnOFhOTv+5sNG1ZSkwQ6UYpgd1nDGQ2nTBBjBwzOkcIi2XNgLYbqLkE89FC6xVUwSzyOqDw3zgluByf+y/GJy5+AKEzFkfFzms3MlBnnsg4SRkrk1etzRb4GUnGxDchCPV8M2zI9/P5aVyiK/ufxYGx6jjiRKs3h3Ix7b8s48S9Qy5JMnhcVVRXIMGxkI2cbuUhTfu+Y1FtEfg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AuMTjLE/xlNajSaKwHXH6y4i7gSDIgQvYW7fbW1dpf1egybua6pi90CgjCrRhQTq8CpeDIneRTGuXBrIf3yLYk/C8Ot12sx2Bedn3/qQbGVpXOACtPkr4BWPb091vG22D+ju3jFCUI0PD5C+Kh9NTutMbV/J7Jx1RC8n4vhfYKY5/nIopUGE25RtB4YhQjTuyOTkXWkYNuwB0MxAv3Sw0Z94dHRQJLe0RIGIEH5hgurqeG0wKHrBCedStuhodKOf4ZjjdQz4eMQb1yEC+HQJGtimtOOp94sG/m77IK2/vy0bsRJ7hkYy3hIlWxPP0uhq/QCXpTAEJkZ56j+kLwYmVg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 03 Jun 2026 13:52:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Jun 03, 2026 at 10:54:38AM +0200, Jan Beulich wrote:
> On 03.06.2026 10:53, Jan Beulich wrote:
> > On 01.06.2026 17:43, Roger Pau Monne wrote:
> >> --- a/xen/common/numa.c
> >> +++ b/xen/common/numa.c
> >> @@ -396,7 +396,13 @@ static int __init populate_memnodemap(const struct 
> >> node *nodes,
> >>  
> >>      for ( i = 0; i < numnodes; i++ )
> >>      {
> >> -        unsigned long spdx = paddr_to_pdx(nodes[i].start);
> >> +        /*
> >> +         * Round down start address: if start is not aligned to the 
> >> memnodemap
> >> +         * chunk size the tail remainder might not be added.  Overlaps 
> >> created
> >> +         * by rounding will fall into the same NUMA region.
> >> +         */
> >> +        unsigned long spdx = ROUNDDOWN(paddr_to_pdx(nodes[i].start),
> >> +                                       1UL << shift);
> > 
> > Imo this rounding would better be done ...
> > 
> >>          unsigned long epdx = paddr_to_pdx(nodes[i].end - 1);
> >>  
> >>          if ( spdx > epdx )
> > 
> > ... only after this check (and then perhaps also after the subsequent if()).
> 
> Oh, and: With that adjustment
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Fair enough, I will adjust the rounding placement.

Thanks, Roger.



 


Rackspace

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