linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: "Christoph Lameter (Ampere)" <cl@gentwo.org>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, Johannes Weiner <hannes@cmpxchg.org>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>
Subject: Re: [PATCH v2 2/6] slub: Use alloc_pages_node() in alloc_slab_page()
Date: Fri, 12 Jul 2024 09:47:15 +0200	[thread overview]
Message-ID: <db4962fb-7394-4516-9819-39d61f4d74b9@suse.cz> (raw)
In-Reply-To: <9d54dab9-64d6-8989-b6df-ca0a28e5cd7c@gentwo.org>

On 7/11/24 8:04 PM, Christoph Lameter (Ampere) wrote:
> On Thu, 11 Jul 2024, Vlastimil Babka wrote:
> 
>>> There are also the cpuset/cgroup restrictions via the zonelists that are
>>> bypassed by removing alloc_pages()
>>
>> AFAICS cpusets are handled on a level that's reached by both paths, i.e.
>> prepare_alloc_pages(), and I see nothing that would make switching to
>> alloc_pages_node() bypass it. Am I missing something?
> 
> You are correct. cpuset/cgroup restrictions also apply to 
> alloc_pages_node().
> 
>>> We have some internal patches now that implement memory policies on a per
>>> object basis for SLUB here.
>>>
>>> This is a 10-15% regression on various benchmarks when objects like the
>>> scheduler statistics structures are misplaced.
>>
>> I believe it would be best if you submitted a patch with with all that
>> reasoning. Thanks!

I still believe that :)

> Turns out those performance issues are related to the issue that NUMA 
> locality is only considered at the folio level for slab allocation. 
> Individual object allocations are not subject to it.
> 
> The performance issue comes about in the following way:
> 
> Two kernel threads run on the same cpu using the same slab cache. One of 
> them keeps on allocating from a different node via kmalloc_node() and the 
> other is using kmalloc(). Then the kmalloc_node() thread will always 
> ensure that the per cpu slab is from the other node.
> 
> The other thread will use kmalloc() which does not check which node the 
> per cpu slab is from. Therefore the kmallc thread can continually be 
> served objects that are not local. That is not good and causes 
> misplacement of objects.
> 
> But that issue is something separate from this commit here and we see the 
> same regression before this commit.
> 
> This patch still needs to be reverted since the rationale for the patch 
> is not right and it disables memory policy support. Results in the 
> strange situation that memory policies are used in get_any_partial() in 
> slub but not during allocation anymore.
> 



  reply	other threads:[~2024-07-12  7:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-28  8:57 [PATCH v2 0/6] Remove some lruvec page accounting functions Matthew Wilcox (Oracle)
2023-12-28  8:57 ` [PATCH v2 1/6] mm: Remove inc/dec lruvec page state functions Matthew Wilcox (Oracle)
2024-01-02 11:02   ` Vlastimil Babka
2023-12-28  8:57 ` [PATCH v2 2/6] slub: Use alloc_pages_node() in alloc_slab_page() Matthew Wilcox (Oracle)
2023-12-28 20:37   ` David Rientjes
2024-01-02 11:06   ` Vlastimil Babka
2024-07-09 17:12   ` Christoph Lameter (Ampere)
2024-07-10 10:35     ` Vlastimil Babka
2024-07-10 16:43       ` Christoph Lameter (Ampere)
2024-07-11  7:54         ` Vlastimil Babka
2024-07-11 18:04           ` Christoph Lameter (Ampere)
2024-07-12  7:47             ` Vlastimil Babka [this message]
2023-12-28  8:57 ` [PATCH v2 3/6] slub: Use folio APIs in free_large_kmalloc() Matthew Wilcox (Oracle)
2023-12-28 20:37   ` David Rientjes
2024-01-02 11:10   ` Vlastimil Babka
2023-12-28  8:57 ` [PATCH v2 4/6] slub: Use a folio in __kmalloc_large_node Matthew Wilcox (Oracle)
2023-12-28 20:37   ` David Rientjes
2024-01-02 11:21   ` Vlastimil Babka
2023-12-28  8:57 ` [PATCH v2 5/6] mm/khugepaged: Use a folio more in collapse_file() Matthew Wilcox (Oracle)
2023-12-28 21:10   ` Zi Yan
2024-01-02 11:24   ` Vlastimil Babka
2023-12-28  8:57 ` [PATCH v2 6/6] mm/memcontrol: Remove __mod_lruvec_page_state() Matthew Wilcox (Oracle)
2023-12-28 21:24   ` Zi Yan
2023-12-28 22:31   ` Shakeel Butt
2024-01-02 11:56   ` Vlastimil Babka

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=db4962fb-7394-4516-9819-39d61f4d74b9@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=linux-mm@kvack.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