[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: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Mon, 1 Jun 2026 19:20:27 +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=DTBWbVR0k+vkE5zxKc6uDTHetfV/b5aNWJjwR8qWucM=; b=S+mDzpUxHuLXk7031TFls+ZzMt/iof8sbqoMHL/WDX+npbkbOA0pvE4DktiR3EcatVk5QMmtx02weaIIZkdu2W8iysqGcLogwmoTJY+bBN+K0MATpteLW3imi4P+DIcIzzhKbG9Ic7vO/qiSTO69PqiBZy+NCxra6htzAwalOYgZhU5N0BKeDbLHVyzgzhU7ZmwSOXT+e+kA6raM6fwVUZleo+mZVCTisICCbXIqt5IHFoLYESNwaqxf6/an/SdxVLqgv5Govz3h5uwiHwErNHnUNlwM5fG5nOdlNJoBjDRQJeccUyX9IcDu2WivFut/PqLUuLg3q5EZC9YLAO3l3w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pYcn1N4X1ZuMc2VBHS7rdRJzlU222PR80lMeFnjniB23PS80yKgS3JQyqfIPE1sp7CfJ6TJgqlz+RkNIvEgGpHlnLg4BLLTE46StZeGPBlwLpATNd9puX6DEEVce7lnUHDf2O7aA0bXkZTbfqrRbkwJ0ZMSn2tIpZudV2zT1qOOFdFiYrHbmgWp6EYj4ranrb4U0yU0N5UU59tNXypWIsOGIS5Ea0NId2myMpd6E1wsCQACBj6jVD4g1wd4wZb9J+XcKrmTrYq40+5PTezftXdSHB4lJiGVzP4us2nNN4LEACMYF4XRsxmicJWhQdvLD3AG2Kg/Kx5WQK6H4CWAsSA==
- 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: xen-devel@xxxxxxxxxxxxxxxxxxxx, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
- Delivery-date: Mon, 01 Jun 2026 17:20:49 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Mon, Jun 01, 2026 at 06:08:49PM +0100, Andrew Cooper wrote:
> On 01/06/2026 4:43 pm, Roger Pau Monne wrote:
> > diff --git a/xen/common/numa.c b/xen/common/numa.c
> > index 8544a1598218..8b2f29597f30 100644
> > --- 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);
> > unsigned long epdx = paddr_to_pdx(nodes[i].end - 1);
> >
> > if ( spdx > epdx )
>
> I like that this comes with a unit test, but this hunk needs to be
> standalone at the start of the series, because it needs backporting.
I was supposed to add a post-commit note about this, but finding the
offending commit took me a lot more time than I was expecting and
forgot to add the note.
Yes, this needs to be backported. I was wondering whether it would be
fine to just backport the fix, leaving the test changes alone. But I
can also split this to a pre-commit.
Thanks, Roger.
|