From: Sayali Patil <sayalip@linux.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Shuah Khan <shuah@kernel.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org,
Ritesh Harjani <ritesh.list@gmail.com>
Cc: David Hildenbrand <david@kernel.org>, Zi Yan <ziy@nvidia.com>,
Michal Hocko <mhocko@kernel.org>,
Oscar Salvador <osalvador@suse.de>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
Dev Jain <dev.jain@arm.com>,
Liam.Howlett@oracle.com, linuxppc-dev@lists.ozlabs.org,
Miaohe Lin <linmiaohe@huawei.com>,
Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Subject: Re: [PATCH v7 00/13] selftests/mm: fix failures and robustness improvements
Date: Thu, 21 May 2026 14:54:37 +0530 [thread overview]
Message-ID: <e5a25cd8-8084-4058-8df4-3da0feedca27@linux.ibm.com> (raw)
In-Reply-To: <cover.1779296493.git.sayalip@linux.ibm.com>
On 21/05/26 12:03, Sayali Patil wrote:
>
> Hi all,
>
> Powerpc systems with a 64K base page size exposed several issues while
> running mm selftests. Some tests assume specific hugetlb configurations,
> use incorrect interfaces, or fail instead of skipping when the required
> kernel features are not available.
>
> This series fixes these issues and improves test robustness.
>
> Please review the patches and provide any feedback or suggestions for
> improvement.
>
> Thanks,
> Sayali
>
> ---
> v6->v7
> - Rebased onto the latest mm-new branch, top commit of the base is
> commit 0cec77cfd531 ("mm/filemap: fix page_cache_prev_miss() when no hole is found")
> - Dropped "selftest/mm: align memory size to huge page size in
> hugepage-mremap test":
> Similar patch has already been merged.
> - For "selftests/mm: skip uffd-stress test when nr_pages_per_cpu is zero":
> Changed format specifier of bytes to %zu as per review
> comment.
> - For "selftests/mm: move hwpoison setup into run_test() and silence
> modprobe output for memory-failure category":
> Added condition to avoid executing the test pipeline for skipped tests and assign
> ret directly.
>
> v6: https://lore.kernel.org/all/cover.1777877814.git.sayalip@linux.ibm.com/
> ---
> v5->v6
> - For "selftests/mm: restore default nr_hugepages value via exit trap
> in charge_reserved_hugetlb.sh":
> Extended trap to include INT and TERM in hugetlb tests to ensure
> nr_hugepages is restored on signal-based exits.
> - For "selftests/mm: restore default nr_hugepages value via exit trap
> in hugetlb_reparenting_test.sh":
> Extended trap to include INT and TERM in hugetlb tests to ensure
> nr_hugepages is restored on signal-based exits.
> - For "selftests/mm: fix cgroup task placement and drop memory.current
> checks in hugetlb_reparenting_test.sh":
> Updated the subshell invocation to pass variables as positional arguments
> instead of interpolating them into the command string as per review comment.
> - For "selftests/mm: move hwpoison setup into run_test() and silence modprobe
> output for memory-failure category":
> Updated the condition to avoid unconditional module removal and ensures it is
> only unloaded if loaded by the test.
>
> v5: https://lore.kernel.org/all/cover.1776150071.git.sayalip@linux.ibm.com/
> ---
> ---
> v4->v5
> - For "selftests/mm: move hwpoison setup into run_test() and silence modprobe
> output for memory-failure category":
> Renamed LOADED_MOD to LOADED_HWPOISON_INJECT_MOD as per review comment.
> - Dropped "selftests/cgroup: extend test_hugetlb_memcg.c to support all huge
> page sizes":
> Due to intermittent failures observed on some systems.
> - Added Tested-by from Venkat for all patches.
> - Added Reviewed-by from Zi yan for patches 7,8 and 13.
> - Added Acked-by from Zi yan for patches 1 and 3.
>
> v4: https://lore.kernel.org/all/cover.1775466329.git.sayalip@linux.ibm.com/
> ---
> v3->v4
>
> - selftests/mm: restore default nr_hugepages value via EXIT
> trap in charge_reserved_hugetlb.sh:
> Updated to use an EXIT trap to restore the original nr_hugepages
> once at script termination, ensuring reliable restoration on all
> exit paths.
>
> - selftest/mm: fix cgroup task placement and drop memory.current checks
> in hugetlb_reparenting_test.sh:
> Updated to use a deterministic synchronization method by migrating the
> workload process within a wrapper subshell before calling exec() to
> ensure correct cgroup accounting.
>
> - selftest/mm: align memory size to huge page size in hugepage-mremap
> test:
> Update test code directly to align memory allocations to the hugepage
> size, rather than modifying run_vmtests.sh. This replaces the previous
> commit “adjust hugepage-mremap test size for large huge pages” with
> a cleaner, direct approach in the test itself.
>
> - selftests/mm: ensure destination is hugetlb-backed in hugepage-mremap:
> Updated to remove MAP_POPULATE flag for the mmap call as per review
> comment.
>
> - selftests/mm: skip uffd-wp-mremap if UFFD write-protect is unsupported:
> Updated as per review comment to initialize features to zero and exit
> on all uffd_get_features() failures, avoiding spurious test errors.
>
> - selftests/mm: move hwpoison setup into run_test() and silence
> modprobe output for memory-failure category:
> Declared LOADED_MOD as local variable and avoided a redundant
> skip message when the module is not found.
> Updated logic to set exitcode to ksft_skip only when no failure has
> been recorded.
>
> - selftests/cgroup: extend test_hugetlb_memcg.c to support all huge
> page sizes:
> Updated to skip on memory constraints instead of returning
> EXIT_FAILURE.
> Updated the logic to fully account for the scenario when the
> per-CPU stock is empty and a refill charges MEMCG_CHARGE_BATCH.
> Updated to avoid overflow on 32-bit systems for memory.max value.
>
> - Included "selftests/mm: restore default nr_hugepages value via
> EXIT trap in hugetlb_reparenting_test.sh"
>
> - Included "selftests/mm: free dynamically allocated PMD-sized
> buffers in split_huge_page_test"
>
> - Included "selftests/mm: clarify alternate unmapping in compaction_test"
>
> - Dropped "selftests/mm: fix double increment in linked list cleanup in
> compaction_test":
> The behaviour is intentional.
>
> v3: https://lore.kernel.org/all/cover.1774591179.git.sayalip@linux.ibm.com/
>
> ---
> v2->v3
> - selftests/mm: skip uffd-wp-mremap if UFFD write-protect is unsupported:
> Rename function to check_uffd_wp_feature_supported() as suggested in review.
> - selftest/mm: fix cgroup task placement and drop memory.current checks
> in hugetlb_reparenting_test.sh:
> Drop memory.current validation from the hugetlb reparenting test.
> Keep tolerance at 7MB (reverting earlier increase to 8MB in v1).
> - Included "selftests/mm: allow PUD-level entries in compound testcase of hmm
> tests" patch:
> Extend the compound testcase checks to accept PUD-level mappings.
> - Included "selftests/mm: replace hardcoded THP size with runtime PMD page size in
> hmm tests" patch:
> Use read_pmd_pagesize() instead of TWOMEG and cap maximum THPs in
> benchmarks to avoid integer overflow.
>
> v2: https://lore.kernel.org/all/cover.1773305677.git.sayalip@linux.ibm.com/
>
> ---
> v1->v2
> - For "selftests/mm: ensure destination is hugetlb-backed in hugepage-mremap":
> update FLAGS definition to MAP_HUGETLB | MAP_SHARED | MAP_POPULATE and
> used it for mmap() calls as suggested during review.
>
> v1: https://lore.kernel.org/all/cover.1773134177.git.sayalip@linux.ibm.com/
> ---
>
> Sayali Patil (13):
> selftests/mm: restore default nr_hugepages value via exit trap in
> charge_reserved_hugetlb.sh
> selftests/mm: fix hugetlb pathname construction in
> charge_reserved_hugetlb.sh
> selftests/mm: restore default nr_hugepages value via exit trap in
> hugetlb_reparenting_test.sh
> selftests/mm: fix hugetlb pathname construction in
> hugetlb_reparenting_test.sh
> selftests/mm: fix cgroup task placement and drop memory.current checks
> in hugetlb_reparenting_test.sh
> selftests/mm: size tmpfs according to PMD page size in
> split_huge_page_test
> selftests/mm: free dynamically allocated PMD-sized buffers in
> split_huge_page_test
> selftest/mm: register existing mapping with userfaultfd in
> hugetlb-mremap
> selftests/mm: ensure destination is hugetlb-backed in hugetlb-mremap
> selftests/mm: skip uffd-wp-mremap if UFFD write-protect is unsupported
> selftests/mm: skip uffd-stress test when nr_pages_per_cpu is zero
> selftests/mm: move hwpoison setup into run_test() and silence modprobe
> output for memory-failure category
> selftests/mm: clarify alternate unmapping in compaction_test
>
> .../selftests/mm/charge_reserved_hugetlb.sh | 45 +++++++++-----
> tools/testing/selftests/mm/compaction_test.c | 3 +
> tools/testing/selftests/mm/hugetlb-mremap.c | 32 +++-------
> .../selftests/mm/hugetlb_reparenting_test.sh | 60 +++++++++---------
> tools/testing/selftests/mm/run_vmtests.sh | 62 ++++++++++++-------
> .../selftests/mm/split_huge_page_test.c | 27 +++++---
> tools/testing/selftests/mm/uffd-stress.c | 6 +-
> tools/testing/selftests/mm/uffd-wp-mremap.c | 13 ++++
> 8 files changed, 151 insertions(+), 97 deletions(-)
>
Hi Andrew,
I checked the AI review comments. Most of them appear to be relatively
minor.
I have sent one fixup patch ("selftests/mm: use ksft_exit_skip() instead
of KSFT_SKIP in uffd-stress") for the comment in "selftests/mm: skip
uffd-stress test when nr_pages_per_cpu is zero". The remaining comments
were either already discussed earlier or can be addressed later if needed.
Please let me know if you have any additional comments or concerns.
Thanks,
Sayali
next prev parent reply other threads:[~2026-05-21 9:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 6:33 [PATCH v7 00/13] selftests/mm: fix failures and robustness improvements Sayali Patil
2026-05-21 6:33 ` [PATCH v7 01/13] selftests/mm: restore default nr_hugepages value via exit trap in charge_reserved_hugetlb.sh Sayali Patil
2026-05-21 6:33 ` [PATCH v7 02/13] selftests/mm: fix hugetlb pathname construction " Sayali Patil
2026-05-21 6:47 ` [PATCH v7 03/13] selftests/mm: restore default nr_hugepages value via exit trap in hugetlb_reparenting_test.sh Sayali Patil
2026-05-21 6:47 ` [PATCH v7 04/13] selftests/mm: fix hugetlb pathname construction " Sayali Patil
2026-05-21 6:47 ` [PATCH v7 05/13] selftests/mm: fix cgroup task placement and drop memory.current checks " Sayali Patil
2026-05-21 6:47 ` [PATCH v7 06/13] selftests/mm: size tmpfs according to PMD page size in split_huge_page_test Sayali Patil
2026-05-21 6:47 ` [PATCH v7 07/13] selftests/mm: free dynamically allocated PMD-sized buffers " Sayali Patil
2026-05-21 6:47 ` [PATCH v7 08/13] selftest/mm: register existing mapping with userfaultfd in hugetlb-mremap Sayali Patil
2026-05-21 6:47 ` [PATCH v7 09/13] selftests/mm: ensure destination is hugetlb-backed " Sayali Patil
2026-05-21 6:47 ` [PATCH v7 10/13] selftests/mm: skip uffd-wp-mremap if UFFD write-protect is unsupported Sayali Patil
2026-05-21 6:47 ` [PATCH v7 11/13] selftests/mm: skip uffd-stress test when nr_pages_per_cpu is zero Sayali Patil
2026-05-21 9:13 ` Sayali Patil
2026-05-21 6:47 ` [PATCH v7 12/13] selftests/mm: move hwpoison setup into run_test() and silence modprobe output for memory-failure category Sayali Patil
2026-05-21 6:47 ` [PATCH v7 13/13] selftests/mm: clarify alternate unmapping in compaction_test Sayali Patil
2026-05-21 9:24 ` Sayali Patil [this message]
2026-05-21 21:54 ` [PATCH v7 00/13] selftests/mm: fix failures and robustness improvements Andrew Morton
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=e5a25cd8-8084-4058-8df4-3da0feedca27@linux.ibm.com \
--to=sayalip@linux.ibm.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@kernel.org \
--cc=osalvador@suse.de \
--cc=ritesh.list@gmail.com \
--cc=shuah@kernel.org \
--cc=venkat88@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox