linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang@gmail.com>
To: David Hildenbrand <david@redhat.com>
Cc: Wei Yang <richard.weiyang@gmail.com>,
	akpm@linux-foundation.org, lorenzo.stoakes@oracle.com,
	ziy@nvidia.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,
	wangkefeng.wang@huawei.com, linux-mm@kvack.org,
	usamaarif642@gmail.com, willy@infradead.org
Subject: Re: [Patch v3 2/2] mm/khugepaged: unify pmd folio installation with map_anon_folio_pmd()
Date: Thu, 9 Oct 2025 01:46:06 +0000	[thread overview]
Message-ID: <20251009014606.fihkxie6lzvrzxay@master> (raw)
In-Reply-To: <c20a69b5-e8d5-4d9e-9716-1fc413704df6@redhat.com>

On Wed, Oct 08, 2025 at 04:45:52PM +0200, David Hildenbrand wrote:
>On 08.10.25 11:54, Wei Yang wrote:
>> Currently we install pmd folio with map_anon_folio_pmd() in
>> __do_huge_pmd_anonymous_page() and do_huge_zero_wp_pmd(). While in
>> collapse_huge_page(), it is done with identical code except statistics
>> adjustment.
>> 
>> Unify the process with map_anon_folio_pmd() to install pmd folio. Split
>> it to map_anon_folio_pmd_pf() and map_anon_folio_pmd_nopf() to be used
>> in page fault or not respectively.
>> 
>> No functional change is intended.
>> 
>> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>> Cc: David Hildenbrand <david@redhat.com>
>> Cc: Lance Yang <lance.yang@linux.dev>
>> Cc: Dev Jain <dev.jain@arm.com>
>> Cc: Zi Yan <ziy@nvidia.com>
>> Cc: Usama Arif <usamaarif642@gmail.com>
>> Cc: Matthew Wilcox <willy@infradead.org>
>> Acked-by: David Hildenbrand <david@redhat.com>
>> Reviewed-by: Zi Yan <ziy@nvidia.com>
>> Acked-by: Lance Yang <lance.yang@linux.dev>
>> 
>> ---
>> v3:
>>    * add static inline and put bracket into separate lines
>>    * rebase on latest mm-new
>> v2:
>>    * split map_anon_folio_pmd_[no]pf() suggested by Matthew
>> ---
>>   include/linux/huge_mm.h |  7 +++++++
>>   mm/huge_memory.c        | 14 ++++++++++----
>>   mm/khugepaged.c         |  9 +--------
>>   3 files changed, 18 insertions(+), 12 deletions(-)
>> 
>> diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
>> index bb48cb50c0ec..588e3522a1d0 100644
>> --- a/include/linux/huge_mm.h
>> +++ b/include/linux/huge_mm.h
>> @@ -542,6 +542,8 @@ void split_huge_pmd_locked(struct vm_area_struct *vma, unsigned long address,
>>   			   pmd_t *pmd, bool freeze);
>>   bool unmap_huge_pmd_locked(struct vm_area_struct *vma, unsigned long addr,
>>   			   pmd_t *pmdp, struct folio *folio);
>> +void map_anon_folio_pmd_nopf(struct folio *folio, pmd_t *pmd,
>> +		struct vm_area_struct *vma, unsigned long haddr);
>>   #else /* CONFIG_TRANSPARENT_HUGEPAGE */
>> @@ -633,6 +635,11 @@ static inline bool unmap_huge_pmd_locked(struct vm_area_struct *vma,
>>   	return false;
>>   }
>> +static inline void map_anon_folio_pmd_nopf(struct folio *folio, pmd_t *pmd,
>> +		struct vm_area_struct *vma, unsigned long haddr)
>> +{
>> +}
>> +
>
>Thinking again, maybe you don't even need this stub? Any calling code should
>be guarded by CONFIG_TRANSPARENT_HUGEPAGE.
>

I think you are right.

I have removed the stub and build with/out CONFIG_TRANSPARENT_HUGEPAGE, both
are fine.

@Andrew, would you mind removing the above static inline stub? Thanks.

>-- 
>Cheers
>
>David / dhildenb

-- 
Wei Yang
Help you, Help me


      reply	other threads:[~2025-10-09  1:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-08  9:54 [Patch v3 0/2] mm/huge_memory: cleanup for pmd folio installation Wei Yang
2025-10-08  9:54 ` [Patch v3 1/2] mm/huge_memory: add pmd folio to ds_queue in do_huge_zero_wp_pmd() Wei Yang
2025-10-08  9:54 ` [Patch v3 2/2] mm/khugepaged: unify pmd folio installation with map_anon_folio_pmd() Wei Yang
2025-10-08 14:24   ` Dev Jain
2025-10-08 14:45   ` David Hildenbrand
2025-10-09  1:46     ` Wei Yang [this message]

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=20251009014606.fihkxie6lzvrzxay@master \
    --to=richard.weiyang@gmail.com \
    --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=lance.yang@linux.dev \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=npache@redhat.com \
    --cc=ryan.roberts@arm.com \
    --cc=usamaarif642@gmail.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=willy@infradead.org \
    --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