selftests/cgroup: improve zswap tests robustness and support large page sizes
Status from this message: [merged mm-stable] selftests-cgroup-test_zswap-wait-for-asynchronous-writeback.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first
Changes in v7 from the cover letter
Replace my work email by [email protected] address. Add Acked-by: Nhat Pham <[email protected]> to series. Rebase to the latest branch (only one tiny conflict resolved).
Patches in v7 All 8 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | selftests/cgroup: skip test_zswap if zswap is globally disabledtools/ | +15 | 1 reply | Applied |
| 2/8 | selftests/cgroup: avoid OOM in test_swapin_nozswaptools/ | +11 | 1 reply | Applied |
| 3/8 | selftests/cgroup: use runtime page size for zswpin checktools/ | +1 | 1 reply | Applied |
| 4/8 | selftests/cgroup: rename PAGE_SIZE to BUF_SIZE in cgroup_utiltools/ tools/ tools/ +2 more | +25 | 2 replies | Applied |
| 5/8 | selftests/cgroup: replace hardcoded page size values in test_zswaptools/ | +25 | 2 replies | Applied |
| 6/8 | selftest/cgroup: fix zswap test_no_invasive_cgroup_shrink on large pagesize systemtools/ | +49 | 1 reply | Applied |
| 7/8 | selftest/cgroup: fix zswap attempt_writeback() on 64K pagesize systemtools/ | +4 | 1 reply | Applied |
| 8/8 | selftests/cgroup: test_zswap: wait for asynchronous writebacktools/ | +26 | 1 reply | Applied |
Reviews trailers per patch
All 8 patches have a Reviewed-by or Acked-by.
| Patch | Yosry Ahmed | Nhat Pham | Jiayuan Chen | Michal Koutný |
|---|---|---|---|---|
| 1/8 | A-b | A-b | R-b | |
| 2/8 | A-b | A-b | ||
| 3/8 | R-b | A-b | R-b | |
| 4/8 | A-b | |||
| 5/8 | A-b | R-b | ||
| 6/8 | A-b | |||
| 7/8 | A-b | A-b | R-b | |
| 8/8 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v7 0/8] selftests/cgroup: improve zswap tests robustness and support large page sizes
This patchset aims to fix various spurious failures and improve the overall robustness of the cgroup zswap selftests.
The primary motivation is to make the tests compatible with architectures that use non-4K page sizes (such as 64K on ppc64le and arm64). Currently, the tests rely heavily on hardcoded 4K page sizes and fixed memory limits. On 64K page size systems, these hardcoded values lead to sub-page granularity accesses, incorrect page count calculations, and insufficient memory pressure to trigger zswap writeback, ultimately causing the tests to fail.
Additionally, this series addresses OOM kills occurring in test_swapin_nozswap by dynamically scaling memory limits, and prevents spurious test failures when zswap is built into the kernel but globally disabled.
Changes in v7:
Replace my work email by [email protected] address. Add Acked-by: Nhat Pham <[email protected]> to series. Rebase to the latest branch (only one tiny conflict resolved).
Changes in v6:
Patch 4/8: Use page_size instead of BUF_SIZE
Declear page_size as int but not size_t
Patch 5/8: Use page_size replace the sysconf(_SC_PAGE_SIZE). Patch 7/8: Adjust the code comments.
Patch 8/8: Declear long type for elapsed and count variables.
Changes in v5:
Patch 1/8: Defined PATH_ZSWAP and PATH_ZSWAP_ENABLED macros. Patch 4/8: Merge Waiman's work into this patch (use page_size). Patch 5/8: Change pagesize by the global page_size.
Patch 6/8: Swap data patterns: use getrandom() for wb_group and simple
memset for zw_group to fix the reversed allocation logic.
Patch 7/8: Setting zswap.max to zswap_usage/4 to increase writeback pressure. Patch 8/8: New added. Just add loops for read zswpwb more times.
Test all passed on:
x86_64(4k), aarch64(4K, 64K), ppc64le(64K).
Li Wang (8):
selftests/cgroup: skip test_zswap if zswap is globally disabled selftests/cgroup: avoid OOM in test_swapin_nozswap selftests/cgroup: use runtime page size for zswpin check selftests/cgroup: rename PAGE_SIZE to BUF_SIZE in cgroup_util selftests/cgroup: replace hardcoded page size values in test_zswap selftest/cgroup: fix zswap test_no_invasive_cgroup_shrink on large
pagesize system
selftest/cgroup: fix zswap attempt_writeback() on 64K pagesize system selftests/cgroup: test_zswap: wait for asynchronous writeback
.../selftests/cgroup/lib/cgroup_util.c | 18 +- .../cgroup/lib/include/cgroup_util.h | 4 +- tools/testing/selftests/cgroup/test_core.c | 2 +- tools/testing/selftests/cgroup/test_freezer.c | 2 +- .../selftests/cgroup/test_memcontrol.c | 19 +- tools/testing/selftests/cgroup/test_zswap.c | 181 ++++++++++++------ 6 files changed, 152 insertions(+), 74 deletions(-)
Signature · 1 line
2.53.0