mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Harry Yoo <harry@kernel.org>
To: Luka Bai <lukafocus@icloud.com>,
	"Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@kernel.org>,
	Lorenzo Stoakes <ljs@kernel.org>, Zi Yan <ziy@nvidia.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	"Liam R. Howlett" <liam@infradead.org>,
	Nico Pache <npache@redhat.com>,
	Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
	Barry Song <baohua@kernel.org>, Lance Yang <lance.yang@linux.dev>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>, Kairui Song <kasong@tencent.com>,
	Qi Zheng <qi.zheng@linux.dev>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	Axel Rasmussen <axelrasmussen@google.com>,
	Yuanchu Xie <yuanchu@google.com>, Wei Xu <weixugc@google.com>,
	Rik van Riel <riel@surriel.com>, Jann Horn <jannh@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	linux-kernel@vger.kernel.org, Luka Bai <lukabai@tencent.com>
Subject: Re: [PATCH 2/5] mm/khugepaged: use slab cache instead of normal kmalloc
Date: Thu, 11 Jun 2026 13:35:46 +0900	[thread overview]
Message-ID: <bdce3c32-54de-4f07-9321-986f49e47767@kernel.org> (raw)
In-Reply-To: <aiooiNyND2Q96b4j@LUKABAI-MC1>


[-- Attachment #1.1: Type: text/plain, Size: 1173 bytes --]



On 6/11/26 12:16 PM, Luka Bai wrote:
> 在 Tue, Jun 09, 2026 at 12:26:18PM +0200,Vlastimil Babka (SUSE) 写道:
>> On 5/31/26 06:23, Luka Bai wrote:
>>> From: Luka Bai <lukabai@tencent.com>
>>>
>>> We added a kmem slab cached called collapse_hint_cache for
>>> khugepaged collapse hint, to improve the performance in allocation
>>> and freeing for the hint structs.
>>>
>>> Signed-off-by: Luka Bai <lukabai@tencent.com>
>>
>> Khugepaged isn't exactly a hotpath? Adding own cache comes with memory
>> overhead, so this doesn't seem like a sufficient reason to do that.
>>
> Hi Vlastimil,
> 
> Thanks for the review :).
> 
> Yeah Khugepaged is not a hotpath. But in my implementation we will allocate
> those khugepaged collapse hint structs in other paths like walk_mm() and
> lru_gen_look_around(), which may be called more frequently under memory
> pressure. I'm a little afraid that directly using kmalloc may compromise
> the performance of reclaimation... What do you think? Thanks. :)

What makes you think using kmalloc compromises the performance under
memory pressure?

> Best regards,
> Luka

-- 
Cheers,
Harry / Hyeonggon

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-06-11  4:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-31  4:23 [PATCH 0/5] mm/khugepaged: add collapse hint machanism for khugepaged and use in mglru Luka Bai
2026-05-31  4:23 ` [PATCH 1/5] mm/khugepaged: add framework for khugepaged collapse hint Luka Bai
2026-05-31  4:23 ` [PATCH 2/5] mm/khugepaged: use slab cache instead of normal kmalloc Luka Bai
2026-06-09 10:26   ` Vlastimil Babka (SUSE)
2026-06-11  3:16     ` Luka Bai
2026-06-11  4:35       ` Harry Yoo [this message]
2026-06-11  9:23         ` Luka Bai
2026-05-31  4:23 ` [PATCH 3/5] mm/khugepaged: add deduplication when adding new collapse hint Luka Bai
2026-05-31  4:23 ` [PATCH 4/5] mm/khugepaged: add accounting for successful hint or non-hint collapse Luka Bai
2026-05-31  4:40 ` [PATCH 0/5] mm/khugepaged: add collapse hint machanism for khugepaged and use in mglru Luka Bai
2026-05-31  4:27 Luka Bai
2026-05-31  4:27 ` [PATCH 2/5] mm/khugepaged: use slab cache instead of normal kmalloc Luka Bai

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=bdce3c32-54de-4f07-9321-986f49e47767@kernel.org \
    --to=harry@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@kernel.org \
    --cc=dev.jain@arm.com \
    --cc=hannes@cmpxchg.org \
    --cc=jannh@google.com \
    --cc=kasong@tencent.com \
    --cc=lance.yang@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=lukabai@tencent.com \
    --cc=lukafocus@icloud.com \
    --cc=mhocko@suse.com \
    --cc=npache@redhat.com \
    --cc=qi.zheng@linux.dev \
    --cc=riel@surriel.com \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=shakeel.butt@linux.dev \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=weixugc@google.com \
    --cc=yuanchu@google.com \
    --cc=ziy@nvidia.com \
    /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

all inboxes | Powered by JetHome®