linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Zi Yan <ziy@nvidia.com>
Cc: Wei Yang <richard.weiyang@gmail.com>,
	wang lian <lianux.mm@gmail.com>,
	David Hildenbrand <david@redhat.com>,
	linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Nico Pache <npache@redhat.com>,
	Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
	Barry Song <baohua@kernel.org>, Vlastimil Babka <vbabka@suse.cz>,
	Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>, Shuah Khan <shuah@kernel.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v5 4/5] selftests/mm: add check_after_split_folio_orders() helper.
Date: Thu, 21 Aug 2025 09:11:45 +0800	[thread overview]
Message-ID: <816d77f1-aa8f-4580-b1cd-b8c81f929fdd@linux.alibaba.com> (raw)
In-Reply-To: <A5A3C9E5-7E90-4EB4-878F-D5143FE0F349@nvidia.com>



On 2025/8/20 21:49, Zi Yan wrote:
> On 20 Aug 2025, at 5:22, Baolin Wang wrote:
> 
>> On 2025/8/19 02:46, Zi Yan wrote:
>>> The helper gathers a folio order statistics of folios within a virtual
>>> address range and checks it against a given order list. It aims to provide
>>> a more precise folio order check instead of just checking the existence of
>>> PMD folios.
>>>
>>> The helper will be used the upcoming commit.
>>>
>>> Signed-off-by: Zi Yan <ziy@nvidia.com>
>>> ---
>>
>> I tested this patch, and it works for me.
>> Tested-by: Baolin Wang <baolin.wang@linux.alibaba.com>
> 
> Thanks.
> 
>>
>> By the way, I moved gather_after_split_folio_orders() to the vm_util.c file as a helper for mTHP collapse checks in my patchset[1]. I'm not sure whether you need to move gather_after_split_folio_orders() to vm_util.c in this patch, or if I should move it in my patchset.
> 
> Feel free to move it in your patchset. My initial version has it in vm_util.c, but
> I realized that its implementation is very limited to folio split check and moved
> it to split_huge_page_test.c. If you find it suitable for your test cases, feel
> free to move it. Just note that the code does not handle memremapped THP, since
> it only checks page flags without checking the PFN. So when a vaddr range is mapped
> to a THP/mTHP head page and some other THP/mTHP tail pages, the code just treats
> the whole vaddr range as if it is mapped to a single THP/mTHP and gets a wrong
> order. After-split folios do not have this concern, so
> gather_after_split_folio_orders() is simplified to not handle such cases.

Thanks for the information. khugepaged also does not have this case, so 
it works well for me.


  reply	other threads:[~2025-08-21  1:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-18 18:46 [PATCH v5 0/5] Better split_huge_page_test result check Zi Yan
2025-08-18 18:46 ` [PATCH v5 1/5] mm/huge_memory: add new_order and offset to split_huge_pages*() pr_debug Zi Yan
2025-08-18 18:46 ` [PATCH v5 2/5] selftests/mm: mark all functions static in split_huge_page_test.c Zi Yan
2025-08-18 18:46 ` [PATCH v5 3/5] selftests/mm: reimplement is_backed_by_thp() with more precise check Zi Yan
2025-08-19  8:54   ` David Hildenbrand
2025-08-19 16:50     ` Zi Yan
2025-08-19 16:58       ` Zi Yan
2025-08-18 18:46 ` [PATCH v5 4/5] selftests/mm: add check_after_split_folio_orders() helper Zi Yan
2025-08-20  9:22   ` Baolin Wang
2025-08-20 13:49     ` Zi Yan
2025-08-21  1:11       ` Baolin Wang [this message]
2025-08-18 18:46 ` [PATCH v5 5/5] selftests/mm: check after-split folio orders in split_huge_page_test Zi Yan

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=816d77f1-aa8f-4580-b1cd-b8c81f929fdd@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=david@redhat.com \
    --cc=dev.jain@arm.com \
    --cc=lianux.mm@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=npache@redhat.com \
    --cc=richard.weiyang@gmail.com \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=shuah@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --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;
as well as URLs for NNTP newsgroup(s).