From: Zi Yan <ziy@nvidia.com>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: akpm@linux-foundation.org, david@redhat.com,
lorenzo.stoakes@oracle.com, baolin.wang@linux.alibaba.com,
Liam.Howlett@oracle.com, npache@redhat.com, ryan.roberts@arm.com,
dev.jain@arm.com, baohua@kernel.org, lance.yang@linux.dev,
xu.xin16@zte.com.cn, chengming.zhou@linux.dev,
linux-mm@kvack.org, Kiryl Shutsemau <kirill@shutemov.name>,
SeongJae Park <sj@kernel.org>
Subject: Re: [Patch v4 2/2] mm/khugepaged: remove definition of struct khugepaged_mm_slot
Date: Mon, 29 Sep 2025 11:16:30 -0400 [thread overview]
Message-ID: <6F2B513B-C0C5-497D-BBA4-9DB19E98D4BF@nvidia.com> (raw)
In-Reply-To: <20250927004539.19308-3-richard.weiyang@gmail.com>
On 26 Sep 2025, at 20:45, Wei Yang wrote:
> Current code calls mm_slot_entry() even when we don't have a valid slot,
> which is not future proof. Currently, this is not a problem because
> "slot" is the first member in struct khugepaged_mm_slot.
>
> While struct khugepaged_mm_slot is just a wrapper of struct mm_slot, there
> is no need to define it.
>
> Remove the definition of struct khugepaged_mm_slot, so there is not chance
> to miss use mm_slot_entry().
>
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
> Acked-by: Lance Yang <lance.yang@linux.dev>
> Reviewed-by: Dev Jain <dev.jain@arm.com>
> Cc: Lance Yang <lance.yang@linux.dev>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Dev Jain <dev.jain@arm.com>
> Cc: Kiryl Shutsemau <kirill@shutemov.name>
> Cc: xu xin <xu.xin16@zte.com.cn>
> Cc: SeongJae Park <sj@kernel.org>
> Cc: Nico Pache <npache@redhat.com>
>
> ---
> v3:
> * adjust changelog
> * rename the slab cache to "mm_slot"
> v2:
> * fix a PF reported by SeongJae, where slot is changed to next one
> ---
> mm/khugepaged.c | 55 ++++++++++++++++---------------------------------
> 1 file changed, 18 insertions(+), 37 deletions(-)
>
Acked-by: Zi Yan <ziy@nvidia.com>
Best Regards,
Yan, Zi
next prev parent reply other threads:[~2025-09-29 15:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-27 0:45 [Patch v4 0/2] mm_slot: fix the usage of mm_slot_entry() Wei Yang
2025-09-27 0:45 ` [Patch v4 1/2] mm/ksm: don't call mm_slot_entry() when the slot is NULL Wei Yang
2025-09-27 8:39 ` Muhammad Usama Anjum
2025-09-28 13:53 ` Dev Jain
2025-09-29 8:13 ` David Hildenbrand
2025-09-29 10:58 ` Kiryl Shutsemau
2025-09-29 15:14 ` Zi Yan
2025-09-27 0:45 ` [Patch v4 2/2] mm/khugepaged: remove definition of struct khugepaged_mm_slot Wei Yang
2025-09-27 8:40 ` Muhammad Usama Anjum
2025-09-29 8:13 ` David Hildenbrand
2025-09-29 15:16 ` Zi Yan [this message]
2025-09-30 6:01 ` Raghavendra K T
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=6F2B513B-C0C5-497D-BBA4-9DB19E98D4BF@nvidia.com \
--to=ziy@nvidia.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=chengming.zhou@linux.dev \
--cc=david@redhat.com \
--cc=dev.jain@arm.com \
--cc=kirill@shutemov.name \
--cc=lance.yang@linux.dev \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=npache@redhat.com \
--cc=richard.weiyang@gmail.com \
--cc=ryan.roberts@arm.com \
--cc=sj@kernel.org \
--cc=xu.xin16@zte.com.cn \
/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