selftests/cgroup: improve zswap tests robustness and support large page sizes
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest8 patches 5 repliesIn review
- v58 patches 6 repliesSuperseded
- v47 patches 14 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 7 patches | 6 replies | Superseded | |
| v2 | 7 patches | 10 replies | Superseded |
Changes in v6 from the cover letter
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.
Patches in v6 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | selftests/cgroup: skip test_zswap if zswap is globally disabledtools/ | +15 | 0 replies | |
| 2/8 | selftests/cgroup: avoid OOM in test_swapin_nozswaptools/ | +11 | 0 replies | |
| 3/8 | selftests/cgroup: use runtime page size for zswpin checktools/ | +1 | 0 replies | |
| 4/8 | selftests/cgroup: rename PAGE_SIZE to BUF_SIZE in cgroup_utiltools/ tools/ tools/ +2 more | +25 | 0 replies | |
| 5/8 | selftests/cgroup: replace hardcoded page size values in test_zswaptools/ | +24 | 1 reply | |
| 6/8 | selftest/cgroup: fix zswap test_no_invasive_cgroup_shrink on large pagesize systemtools/ | +49 | 2 replies | |
| 7/8 | selftest/cgroup: fix zswap attempt_writeback() on 64K pagesize systemtools/ | +4 | 1 reply | |
| 8/8 | selftests/cgroup: test_zswap: wait for asynchronous writebacktools/ | +26 | 1 reply |
Reviews trailers per patch
7 of 8 patches have a Reviewed-by or Acked-by.
| Patch | Yosry Ahmed | Nhat Pham |
|---|---|---|
| 1/8 | A-b | A-b |
| 2/8 | A-b | A-b |
| 3/8 | R-b | A-b |
| 4/8 | ||
| 5/8 | A-b | A-b |
| 6/8 | A-b | |
| 7/8 | A-b | A-b |
| 8/8 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v6 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 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 | 179 ++++++++++++------ 6 files changed, 151 insertions(+), 73 deletions(-)
Signature · 1 line
2.53.0