diff options
| author | Harry Yoo (Meta) <harry@kernel.org> | 2026-09-14 21:36:39 +0100 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-09-29 23:13:27 -0700 |
| commit | bd2e6a28a56a4bf324cc48157c247bc94d66d93d (patch) | |
| tree | 1525112853a737d6378a008e4f1d1181d64762b6 /scripts/patch-kernel | |
| parent | 1e0bf803be75d4ade312638bab490eb1f8918c29 (diff) | |
| download | linux-next-bd2e6a28a56a4bf324cc48157c247bc94d66d93d.tar.gz linux-next-bd2e6a28a56a4bf324cc48157c247bc94d66d93d.zip | |
selftests/cgroup: ignore memory.reclaim -EAGAIN for zswap writeback test
The zswap_writeback_enabled test fails when a write to memory.reclaim
returns -EAGAIN, which means less than the requested amount was reclaimed.
attempt_writeback() propagates the -EAGAIN to the caller, and the test
case is marked as failed even when zswap writeback did happen.
This heavily depends on the performance of the backing swap device.
Reclaim does not wait for writeback (on cgroup v2), does not count pages
that are under writeback as reclaimed, and memory.reclaim gives up after
MAX_RECLAIM_RETRIES passes without making progress. On a slow device
where reclaim does not make any progress before writeback completes, a
write to memory.reclaim fails.
On a VM with zswap enabled, where IO delay was injected via dm-delay, the
success rate of the zswap writeback test drops dramatically once the delay
reaches 11 ms: 7% failures at 10 ms and 79% failures at 11 ms, n = 100.
When zswap writeback is enabled, ignore -EAGAIN from memory.reclaim and
determine pass/fail based on the zswpwb counter because that is what
zswap_writeback_enabled actually wants to test.
With this change, the test reliably passes even on a slow swap device
(tested up to 1000 ms delay). This makes the test resilient against the
performance of the swap device.
Link: https://lore.kernel.org/20260914-test-zswap-wb-ignore-eagain-v1-1-6fb715c22cd8@kernel.org
Fixes: 158863e5d7cc ("selftests: cgroup: add tests to verify the zswap writeback path")
Signed-off-by: Harry Yoo (Meta) <harry@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: SJ Park <sj@kernel.org>
Acked-by: Nhat Pham <nphamcs@gmail.com>
Assisted-by: LLM
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Kiryl Shutsemau <kas@kernel.org>
Cc: Michal Koutný <mkoutny@suse.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Usama Arif <usamaarif642@gmail.com>
Diffstat (limited to 'scripts/patch-kernel')
0 files changed, 0 insertions, 0 deletions
