Re: [PATCH v6 8/8] selftests/cgroup: test_zswap: wait for asynchronous writeback
From: Nhat Pham
Date: Sun Apr 12 2026 - 20:01:53 EST
On Wed, Apr 1, 2026 at 11:38 PM Li Wang <liwang@xxxxxxxxxx> wrote:
>
> zswap writeback is asynchronous, but test_zswap.c checks writeback
> counters immediately after reclaim/trigger paths. On some platforms
> (e.g. ppc64le), this can race with background writeback and cause
> spurious failures even when behavior is correct.
>
> Add wait_for_writeback() to poll get_cg_wb_count() with a bounded
> timeout, and use it in:
>
> test_zswap_writeback_one() when writeback is expected
> test_no_invasive_cgroup_shrink() for the wb_group check
>
> This keeps the original before/after assertion style while making the
> tests robust against writeback completion latency.
>
> No test behavior change, selftest stability improvement only.
>
> Signed-off-by: Li Wang <liwang@xxxxxxxxxx>
LGTM.
Acked-by: Nhat Pham <nphamcs@xxxxxxxxx>