mirror-linux/tools/testing
Li Wang e487a5d513 selftest/mm: make hugetlb_reparenting_test tolerant to async reparenting
In cgroup v2, memory and hugetlb usage reparenting is asynchronous.  This
can cause test flakiness when immediately asserting usage after deleting a
child cgroup.  To address this, add a helper function
`assert_with_retry()` that checks usage values with a timeout-based retry.
This improves test stability without relying on fixed sleep delays.

Also bump up the tolerance size to 7MB.

To avoid False Positives:
  ...
  # Assert memory charged correctly for child only use.
  # actual a = 11 MB
  # expected a = 0 MB
  # fail
  # cleanup
  # [FAIL]
  not ok 11 hugetlb_reparenting_test.sh -cgroup-v2 # exit=1
  # 0
  # SUMMARY: PASS=10 SKIP=0 FAIL=1

Link: https://lkml.kernel.org/r/20250407084201.74492-1-liwang@redhat.com
Signed-off-by: Li Wang <liwang@redhat.com>
Tested-by: Donet Tom <donettom@linux.ibm.com>
Cc: Waiman Long <longman@redhat.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Kirill A. Shuemov <kirill.shutemov@linux.intel.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-05-11 17:48:18 -07:00
..
crypto/chacha20-s390 crypto: lib/chacha - remove unused arch-specific init support 2025-03-21 17:39:06 +08:00
cxl cxl: Fix devm host device for CXL fwctl initialization 2025-04-18 09:33:04 -07:00
fault-injection
ktest ktest: Fix Test Failures Due to Missing LOG_FILE Directories 2025-03-27 09:34:00 -04:00
kunit ASoC: stm32: sai: fix kernel rate configuration 2025-05-01 14:43:44 +09:00
memblock memblock tests: add test for memblock_set_node 2025-04-07 09:28:01 +03:00
nvdimm
radix-tree xarray: add xas_try_split() to split a multi-index entry 2025-03-17 22:06:59 -07:00
rbtree lib/interval_tree: add test case for span iteration 2025-03-17 12:17:01 -07:00
scatterlist
selftests selftest/mm: make hugetlb_reparenting_test tolerant to async reparenting 2025-05-11 17:48:18 -07:00
shared test suite: use %zu to print size_t 2025-04-11 17:32:35 -07:00
vma mm: make vma cache SLAB_TYPESAFE_BY_RCU 2025-03-16 22:06:21 -07:00
vsock