Re: [PATCH 3/6] mm/damon/tests/core-kunit: test sz_ops_filter_passed_last
From: SJ Park
Date: Mon Nov 16 2026 - 21:23:02 EST
On Mon, 16 Nov 2026 19:10:06 +0000 Mattathias Pinchover via B4 Relay <devnull+mattathias.pinchover.uber.com@xxxxxxxxxx> wrote:
> From: Mattathias Pinchover <mattathias.pinchover@xxxxxxxx>
>
> Add a kunit test for the sz_ops_filter_passed_last DAMOS
> stat. The test runs kdamond_apply_schemes() for multiple apply intervals
> with a stub apply_scheme() operation that reports a given ops
> filter-passed size, and checks that the stat is set to the value of the
> last apply interval rather than the accumulated value, and that it is
> kept unchanged until the next apply interval is completed.
>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Mattathias Pinchover <mattathias.pinchover@xxxxxxxx>
> ---
> mm/damon/tests/core-kunit.h | 92 +++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 92 insertions(+)
>
> diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h
> index a5ca4bfe2f0d..ec83598fff0e 100644
> --- a/mm/damon/tests/core-kunit.h
> +++ b/mm/damon/tests/core-kunit.h
[...]
> + s = damon_new_scheme(&pattern, DAMOS_STAT, 0, "a, &wmarks,
> + NUMA_NO_NODE);
> + if (!s) {
> + damon_destroy_ctx(c);
> + kunit_skip(test, "scheme alloc fail");
> + }
> + damon_add_scheme(c, s);
Sashiko concerns [1] the fact s->core_filters_default_reject is unset. How
about calling damos_set_filters_default_reject() just before
damon_add_scheme()?
[1] https://lore.kernel.org/sashiko-outbox-217563@xxxxxxxxxx
Thanks,
SJ
[...]