From: Lance Yang <lance.yang@linux.dev>
To: Dev Jain <dev.jain@arm.com>
Cc: ziy@nvidia.com, baolin.wang@linux.alibaba.com,
Liam.Howlett@oracle.com, npache@redhat.com, ryan.roberts@arm.com,
baohua@kernel.org, ioworker0@gmail.com, david@redhat.com,
richard.weiyang@gmail.com, lorenzo.stoakes@oracle.com,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
linux-mm@kvack.org
Subject: Re: [PATCH mm-new v3 3/3] mm/khugepaged: merge PTE scanning logic into a new helper
Date: Fri, 10 Oct 2025 18:42:13 +0800 [thread overview]
Message-ID: <6eee7e44-cdf6-45c6-8114-b62c57a2a4e3@linux.dev> (raw)
In-Reply-To: <ce95ab8a-70dc-4159-b38b-dd9f3ffc9aa1@arm.com>
On 2025/10/10 17:10, Dev Jain wrote:
>
> On 08/10/25 10:07 am, Lance Yang wrote:
>> }
>> }
>>
>> +/*
>> + * thp_collapse_check_pte - Check if a PTE is suitable for THP collapse
>> + * @pte: The PTE to check
>> + * @vma: The VMA the PTE belongs to
>> + * @addr: The virtual address corresponding to this PTE
>> + * @foliop: On success, used to return a pointer to the folio
>> + * Must be non-NULL
>> + * @none_or_zero: Counter for none/zero PTEs. Must be non-NULL
>> + * @unmapped: Counter for swap PTEs. Can be NULL if not scanning swaps
>> + * @shared: Counter for shared pages. Must be non-NULL
>> + * @scan_result: Used to return the failure reason (SCAN_*) on a
>> + * PTE_CHECK_FAIL return. Must be non-NULL
>> + * @cc: Collapse control settings
>> + *
>> + * Returns:
>> + * PTE_CHECK_SUCCEED - PTE is suitable, proceed with further checks
>> + * PTE_CHECK_CONTINUE - Skip this PTE and continue scanning
>> + * PTE_CHECK_FAIL - Abort collapse scan
>> + */
>> +static inline int thp_collapse_check_pte(pte_t pte, struct vm_area_struct *vma,
>> + unsigned long addr, struct folio **foliop, int *none_or_zero,
>> + int *unmapped, int *shared, int *scan_result,
>> + struct collapse_control *cc)
>> +{
>> + struct folio *folio = NULL;
>
> I think initialization is not needed here?Otherwise, LGTM. Reviewed-by: Dev Jain <dev.jain@arm.com>
Yep. It's a minor thing, so I'll fold that in if a new version is
needed. Thanks!
next prev parent reply other threads:[~2025-10-10 10:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-08 4:37 [PATCH mm-new v3 0/3] refactor and merge PTE scanning logic Lance Yang
2025-10-08 4:37 ` [PATCH mm-new v3 1/3] mm/khugepaged: optimize PTE scanning with if-else-if-else-if chain Lance Yang
2025-10-14 12:17 ` Lorenzo Stoakes
2025-10-14 12:27 ` David Hildenbrand
2025-10-15 4:49 ` Lance Yang
2025-10-15 9:16 ` Lorenzo Stoakes
2025-10-15 9:31 ` Lance Yang
2025-10-08 4:37 ` [PATCH mm-new v3 2/3] mm/khugepaged: use VM_WARN_ON_FOLIO instead of VM_BUG_ON_FOLIO for non-anon folios Lance Yang
2025-10-14 12:25 ` Lorenzo Stoakes
2025-10-08 4:37 ` [PATCH mm-new v3 3/3] mm/khugepaged: merge PTE scanning logic into a new helper Lance Yang
2025-10-09 1:07 ` Andrew Morton
2025-10-09 1:49 ` Lance Yang
2025-10-10 9:10 ` Dev Jain
2025-10-10 10:42 ` Lance Yang [this message]
2025-10-10 13:29 ` Wei Yang
2025-10-10 13:55 ` Lance Yang
2025-10-14 12:36 ` Lorenzo Stoakes
2025-10-14 17:41 ` Lorenzo Stoakes
2025-10-15 1:48 ` Lance Yang
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=6eee7e44-cdf6-45c6-8114-b62c57a2a4e3@linux.dev \
--to=lance.yang@linux.dev \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@redhat.com \
--cc=dev.jain@arm.com \
--cc=ioworker0@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.