From: Vlastimil Babka <vbabka@suse.cz>
To: cl@gentwo.org, "Matthew Wilcox (Oracle)" <willy@infradead.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Pekka Enberg <penberg@kernel.org>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Andrew Morton <akpm@linux-foundation.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Hyeonggon Yoo <42.hyeyoo@gmail.com>,
Yang Shi <shy828301@gmail.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@kernel.org
Subject: Re: [PATCH] Reenable NUMA policy support in the slab allocator
Date: Mon, 26 Aug 2024 21:44:47 +0200 [thread overview]
Message-ID: <f62fba18-972e-46be-8832-e5ce21ddf9c3@suse.cz> (raw)
In-Reply-To: <20240819-numa_policy-v1-1-f096cff543ee@gentwo.org>
On 8/19/24 20:54, Christoph Lameter via B4 Relay wrote:
> From: Christoph Lameter <cl@gentwo.org>
>
> Revert commit 8014c46ad991 ("slub: use alloc_pages_node() in alloc_slab_page()").
>
> The patch disabled the numa policy support in the slab allocator. It
> did not consider that alloc_pages() uses memory policies but
> alloc_pages_node() does not.
>
> As a result of this patch slab memory allocations are no longer spread via
> interleave policy across all available NUMA nodes on bootup. Instead
> all slab memory is allocated close to the boot processor. This leads to
> an imbalance of memory accesses on NUMA systems.
>
> Also applications using MPOL_INTERLEAVE as a memory policy will no longer
> spread slab allocations over all nodes in the interleave set but allocate
> memory locally. This may also result in unbalanced allocations
> on a single numa node.
>
> SLUB does not apply memory policies to individual object allocations.
> However, it relies on the page allocators support of memory policies
> through alloc_pages() to do the NUMA memory allocations on a per
> folio or page level. SLUB also applies memory policies when retrieving
> partial allocated slab pages from the partial list.
>
> Fixes: 8014c46ad991 ("slub: use alloc_pages_node() in alloc_slab_page()")
> Cc: stable@kernel.org
I'm removing this as (unlike the stable tree maintainers) I try to follow
the stable tree rules, and this wouldn't apply by them. Also it's a revert
of 6.8 commit, so the LTS kernel 6.6 doesn't care anyway.
> Signed-off-by: Christoph Lameter <cl@gentwo.org>
Thanks, added to slab/for-next
> ---
> mm/slub.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index c9d8a2497fd6..4dea3c7df5ad 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -2318,7 +2318,11 @@ static inline struct slab *alloc_slab_page(gfp_t flags, int node,
> struct slab *slab;
> unsigned int order = oo_order(oo);
>
> - folio = (struct folio *)alloc_pages_node(node, flags, order);
> + if (node == NUMA_NO_NODE)
> + folio = (struct folio *)alloc_pages(flags, order);
> + else
> + folio = (struct folio *)__alloc_pages_node(node, flags, order);
> +
> if (!folio)
> return NULL;
>
>
> ---
> base-commit: b0da640826ba3b6506b4996a6b23a429235e6923
> change-id: 20240806-numa_policy-5188f44ba0d8
>
> Best regards,
next prev parent reply other threads:[~2024-08-26 19:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 18:54 Christoph Lameter via B4 Relay
2024-08-20 19:24 ` Yang Shi
2024-08-26 19:44 ` Vlastimil Babka [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-08-12 17:55 Christoph Lameter via B4 Relay
2024-08-13 17:05 ` Yang Shi
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=f62fba18-972e-46be-8832-e5ce21ddf9c3@suse.cz \
--to=vbabka@suse.cz \
--cc=42.hyeyoo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.org \
--cc=hannes@cmpxchg.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=shy828301@gmail.com \
--cc=stable@kernel.org \
--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