All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Sang-Heon Jeon <ekffu200098@gmail.com>
Cc: akpm@linux-foundation.org, djbw@kernel.org, mingo@kernel.org,
	linux-mm@kvack.org, Donghyeon Lee <asd142513@gmail.com>,
	Munhui Chae <mochae@student.42seoul.kr>
Subject: Re: [PATCH v2] mm/fake-numa: fix under-allocation detection in uniform split
Date: Fri, 24 Apr 2026 12:05:56 +0300	[thread overview]
Message-ID: <aesydC2-WX-sYrgc@kernel.org> (raw)
In-Reply-To: <CABFDxMExN86rK0h0XesE7rT7TjCZbYS9_dmb6dES+eJ0hN1EEg@mail.gmail.com>

On Wed, Apr 22, 2026 at 06:26:34PM +0900, Sang-Heon Jeon wrote:
> Hello,
> 
> On Wed, Apr 22, 2026 at 5:36 PM Mike Rapoport <rppt@kernel.org> wrote:
> >
> > On Tue, Apr 21, 2026 at 03:56:01PM +0900, Sang-Heon Jeon wrote:
> > > Hi
> > >
> > > On Tue, Apr 21, 2026 at 3:29 PM Mike Rapoport <rppt@kernel.org> wrote:
> > > >
> > > > On Mon, Apr 20, 2026 at 11:26:13PM +0900, Sang-Heon Jeon wrote:
> > > > > On Mon, Apr 20, 2026 at 3:31 PM Mike Rapoport <rppt@kernel.org> wrote:
> > > > > > On Fri, Apr 17, 2026 at 10:58:05PM +0900, Sang-Heon Jeon wrote:
> > > > > > > When split NUMA node uniformly, split_nodes_size_interleave_uniform()
> > > > > > > returns the next absolute node ID, not the number of nodes created.
> > > > > > >
> > > > > > > The existing under-allocation detection logic compares next absolute node
> > > > > > > ID (ret) and request count (n), which only works when nid starts at 0.
> > > > > > >
> > > > > > > For example, on a system with 2 physical NUMA nodes (node 0: 2GB, node
> > > > > > > 1: 128MB) and numa=fake=8U, 8 fake nodes are successfully created from
> > > > > > > node 0 and split_nodes_size_interleave_uniform() returns 8. For node 1,
> > > > > > > fake node nid starts at 8, but only 4 fake nodes are created due to
> > > > > > > current FAKE_NODE_MIN_SIZE being 32MB, and
> > > > > > > split_nodes_size_interleave_uniform() returns 12. By existing
> > > > > > > under-allocation detection logic, "ret < n" (12 < 8) is false, so the
> > > > > >
> > > > > > In this example it would be 11, won't it?
> > > > > > I'll update when applying.
> > > > >
> > > > > Oops, my previous reply is not the main point of this review. (Please ignore it)
> > > > > But 12 is still correct, because split_nodes_size_interleave_uniform()
> > > > > returns next available node ID.
> > > > >
> > > > > IMHO, it would be clearer if both the commit message and the function
> > > > > comment change into "next available node ID".
> > > > > If you're okay with it, I'll create v3 patch soon, including minor fix below
> > > >
> > > > No need for v3, I updated the comment and the whitespace:
> > > > https://git.kernel.org/rppt/memblock/c/a34436ac05e76bd6634a89fc0a399ab3a48f509a
> > >
> > > Thanks for your help, Mike. However, it seems like '12' was changed to
> > > '11' in the commit message. I think this change should be rolled back.
> > > Could you check?
> >
> > Node IDs are counted from 0, hence for 12 nodes the last nid would be 11.
> 
> Right, the last nid is indeed 11. However, the return value `ret` here
> refers to the next nid, so it should be 12 in this example.

Fixed now, thanks!
 
> Best Regards,
> Sang-Heon Jeon

-- 
Sincerely yours,
Mike.


      reply	other threads:[~2026-04-24  9:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-17 13:58 [PATCH v2] mm/fake-numa: fix under-allocation detection in uniform split Sang-Heon Jeon
2026-04-20  6:31 ` Mike Rapoport
2026-04-20 13:50   ` Sang-Heon Jeon
2026-04-20 14:26   ` Sang-Heon Jeon
2026-04-21  6:29     ` Mike Rapoport
2026-04-21  6:56       ` Sang-Heon Jeon
2026-04-22  8:36         ` Mike Rapoport
2026-04-22  9:26           ` Sang-Heon Jeon
2026-04-24  9:05             ` Mike Rapoport [this message]

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=aesydC2-WX-sYrgc@kernel.org \
    --to=rppt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=asd142513@gmail.com \
    --cc=djbw@kernel.org \
    --cc=ekffu200098@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=mingo@kernel.org \
    --cc=mochae@student.42seoul.kr \
    /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.