Re: [PATCH] mm/damon/tests/core-kunit: improve nr_samples_per_aggr test isolation

From: Lian Wang

Date: Tue Sep 08 2026 - 02:56:44 EST


On Tue, 8 Sep 2026 14:36:35 +0800 Kunwu Chan <kunwu.chan@xxxxxxxxx> wrote:

> The damon_nr_samples_per_aggr() test sets both intervals to zero,
> which exercises two different fallback paths at once.
>
> Use separate compound initializers for each case so that each case
> tests one fallback path independently. Also make the overflow case
> use an explicit non-zero sample interval so that it does not depend
> on the zero sample interval fallback.

Hi Kunwu,

The separate initializers now exercise the zero sample-interval fallback,
the zero samples-per-aggregation fallback, and the 64-bit UINT_MAX saturation
path independently. Using a sample interval of one for the last case also
keeps it independent from the zero sample-interval fallback.

Looks good to me.

Reviewed-by: Lian Wang <lianux.mm@xxxxxxxxx>

Thanks,
Lian