From: Lance Yang <lance.yang@linux.dev>
To: ljs@kernel.org
Cc: david@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com,
liam@infradead.org, nico.pache@linux.dev, ryan.roberts@arm.com,
dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev,
usama.arif@linux.dev, kas@kernel.org, akpm@linux-foundation.org,
peterz@infradead.org, mingo@redhat.com, will@kernel.org,
boqun@kernel.org, longman@redhat.com, surenb@google.com,
vbabka@kernel.org, shakeel.butt@linux.dev,
yonghong.song@linux.dev, ast@kernel.org, daniel@iogearbox.net,
andrii@kernel.org, eddyz87@gmail.com, memxor@gmail.com,
martin.lau@linux.dev, song@kernel.org, jolsa@kernel.org,
emil@etsalapatis.com, ihor.solodrai@linux.dev,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH 1/5] Revert "mm/khugepaged: remove definition of struct khugepaged_mm_slot"
Date: Wed, 4 Nov 2026 15:46:13 +0800 [thread overview]
Message-ID: <20261104074613.30583-1-lance.yang@linux.dev> (raw)
In-Reply-To: <20261103-khugepaged-latency-fix-v1-1-a07ab16ac860@kernel.org>
On Tue, Nov 03, 2026 at 08:27:42AM +0000, Lorenzo Stoakes (ARM) wrote:
>This partially reverts commit b4c9ffb54b32 ("mm/khugepaged: remove
>definition of struct khugepaged_mm_slot"), as a subsequent commit needs to
>resurrect this type to store additional data alongside the mm_slot.
>
>The stated intent of the commit was to address a NULL check in
>__khugepaged_exit():
>
> mm_slot = mm_slot_entry(slot, struct khugepaged_mm_slot, slot);
>
>slot can be NULL and mm_slot_entry() is an alias for container_of(), so
>this is container_of() a NULL value.
>
>This was benign as there was only 1 field in khugepaged_mm_slot (offsetting
>NULL at 0 results in NULL), however it was right to fix this, so retain the
>fix.
>
>It also unwrapped KMEM_CACHE() in khugepaged_init(). This was a mistake,
>and was itself reverted in commit c14bdcc9f274 ("mm/khugepaged: use
>KMEM_CACHE()"). Therefore, retain the KMEM_CACHE() form in this revert.
>
>Signed-off-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
>---
With patch #02 adding a per-mm scan position, bringing khugepaged_mm_slot
back looks reasonable to me ;)
Reviewed-by: Lance Yang <lance.yang@linux.dev>
next prev parent reply other threads:[~2026-11-04 7:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 8:27 [PATCH 0/5] mm/khugepaged: bound mmap_lock hold time when walking an mm's VMAs Lorenzo Stoakes (ARM)
2026-11-03 8:27 ` [PATCH 1/5] Revert "mm/khugepaged: remove definition of struct khugepaged_mm_slot" Lorenzo Stoakes (ARM)
2026-11-04 7:46 ` Lance Yang [this message]
2026-11-03 8:27 ` [PATCH 2/5] mm/khugepaged: scan mm's more efficiently under mmap_lock contention Lorenzo Stoakes (ARM)
2026-11-04 8:43 ` Lance Yang
2026-11-03 8:27 ` [PATCH 3/5] locking/rwsem: add down_read[_killable]_nosteal() Lorenzo Stoakes (ARM)
2026-11-03 11:51 ` Peter Zijlstra
2026-11-03 12:24 ` Lorenzo Stoakes (ARM)
2026-11-03 8:27 ` [PATCH 4/5] mm: add and use mmap_read_lock[_killable]_nosteal() on contention Lorenzo Stoakes (ARM)
2026-11-03 8:27 ` [PATCH 5/5] mm/khugepaged: drop/reacquire mmap read lock if skipped enough VMAs Lorenzo Stoakes (ARM)
2026-11-03 8:49 ` sashiko-bot
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=20261104074613.30583-1-lance.yang@linux.dev \
--to=lance.yang@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=boqun@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=kas@kernel.org \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=longman@redhat.com \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=mingo@redhat.com \
--cc=nico.pache@linux.dev \
--cc=peterz@infradead.org \
--cc=ryan.roberts@arm.com \
--cc=shakeel.butt@linux.dev \
--cc=song@kernel.org \
--cc=surenb@google.com \
--cc=usama.arif@linux.dev \
--cc=vbabka@kernel.org \
--cc=will@kernel.org \
--cc=yonghong.song@linux.dev \
--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