From: "Christoph Lameter (Ampere)" <cl@gentwo.org>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: David Rientjes <rientjes@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Harry Yoo <harry.yoo@oracle.com>,
Matthew Wilcox <willy@infradead.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] mm, slab: support NUMA policy for large kmalloc
Date: Fri, 30 May 2025 12:05:20 -0700 (PDT) [thread overview]
Message-ID: <17a999f3-7e6b-17d4-2caf-4912221894ec@gentwo.org> (raw)
In-Reply-To: <b8a5dc9d-3697-47b3-bf66-f9bd726389fb@suse.cz>
On Thu, 29 May 2025, Vlastimil Babka wrote:
> On 5/29/25 16:57, Christoph Lameter (Ampere) wrote:
> > On Thu, 29 May 2025, Vlastimil Babka wrote:
> >
> >> The slab allocator observes the task's numa policy in various places
> >> such as allocating slab pages. Large kmalloc allocations currently do
> >> not, which seems to be an unintended omission. It is simple to correct
> >> that, so make ___kmalloc_large_node() behave the same way as
> >> alloc_slab_page().
> >
> > Large kmalloc allocation lead to the use of the page allocator which
> > implements the NUMA policies for the allocations.
> >
> > This patch is not necessary.
>
> I'm confused, as that's only true depending on which page allocator entry
> point you use. AFAICS before this series, it's using
> alloc_pages_node_noprof() which only does
>
>
> if (nid == NUMA_NO_NODE)
> nid = numa_mem_id();
>
> and no mempolicies.
That is a bug.
> I see this patch as analogical to your commit 1941b31482a6 ("Reenable NUMA
> policy support in the slab allocator")
>
> Am I missing something?
The page allocator has its own NUMA suport.
The patch to reenable NUMA support dealt with an issue within the
allocator where the memory policies were ignored.
It seems that the error was repeated for large kmalloc allocations.
Instead of respecting memory allocation policies the allocation is forced
to be local to the node.
The forcing to the node is possible with GFP_THISNODE. The default needs
to be following memory policies.
next prev parent reply other threads:[~2025-05-30 19:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-29 8:56 [PATCH 0/2] frozen pages " Vlastimil Babka
2025-05-29 8:56 ` [PATCH 1/2] mm, slab: use " Vlastimil Babka
2025-05-29 15:46 ` Roman Gushchin
2025-05-30 16:59 ` Matthew Wilcox
2025-05-30 4:17 ` Harry Yoo
2025-05-29 8:56 ` [PATCH 2/2] mm, slab: support NUMA policy " Vlastimil Babka
2025-05-29 14:57 ` Christoph Lameter (Ampere)
2025-05-29 15:59 ` Vlastimil Babka
2025-05-30 19:05 ` Christoph Lameter (Ampere) [this message]
2025-06-02 8:24 ` Vlastimil Babka
2025-05-30 7:11 ` Harry Yoo
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=17a999f3-7e6b-17d4-2caf-4912221894ec@gentwo.org \
--to=cl@gentwo.org \
--cc=akpm@linux-foundation.org \
--cc=harry.yoo@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=vbabka@suse.cz \
--cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox