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: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH for-4.22 5/5] xen/numa: fix setup of non-aligned memory affinity ranges
Date: Wed, 3 Jun 2026 15:52:15 +0200	[thread overview]
Message-ID: <aiAxj4jOP5A7mRfI@macbook.local> (raw)
In-Reply-To: <d17f835b-3095-4d08-b2bd-7ab69e08db45@suse.com>

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@suse.com>

Fair enough, I will adjust the rounding placement.

Thanks, Roger.


  reply	other threads:[~2026-06-03 13:52 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-01 15:43 [PATCH for-4.22 0/5] numa: add unit testing plus fix regression Roger Pau Monne
2026-06-01 15:43 ` [PATCH for-4.22 1/5] tools/bitops: adjust bitmap_or() interface to match hypervisor Roger Pau Monne
2026-06-03 14:34   ` Anthony PERARD
2026-06-03 19:03     ` Roger Pau Monné
2026-06-01 15:43 ` [PATCH for-4.22 2/5] tools/macros: adjust ROUNDUP() " Roger Pau Monne
2026-06-03 15:15   ` Anthony PERARD
2026-06-01 15:43 ` [PATCH for-4.22 3/5] xen/numa: prepare NUMA setup code for unit testing Roger Pau Monne
2026-06-03  8:27   ` Jan Beulich
2026-06-01 15:43 ` [PATCH for-4.22 4/5] tests/numa: add unit tests for NUMA setup logic Roger Pau Monne
2026-06-03  8:38   ` Jan Beulich
2026-06-03 13:45     ` Roger Pau Monné
2026-06-03 13:54       ` Jan Beulich
2026-06-03 14:07         ` Roger Pau Monné
2026-06-01 15:43 ` [PATCH for-4.22 5/5] xen/numa: fix setup of non-aligned memory affinity ranges Roger Pau Monne
2026-06-01 17:08   ` Andrew Cooper
2026-06-01 17:20     ` Roger Pau Monné
2026-06-02 10:26       ` Jan Beulich
2026-06-03  8:53   ` Jan Beulich
2026-06-03  8:54     ` Jan Beulich
2026-06-03 13:52       ` Roger Pau Monné [this message]
2026-06-02  7:23 ` [PATCH for-4.22 0/5] numa: add unit testing plus fix regression Oleksii Kurochko

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=aiAxj4jOP5A7mRfI@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=oleksii.kurochko@gmail.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.