Re: [PATCH v2 1/5] mm/damon/tests/core-kunit: verify the 'age' field in damon_test_split_at()

SeongJae Park
2025-12-24T05:26:15Z

On Wed, 24 Dec 2025 04:21:56 +0000 Shu Anzai <shu17az@gmail.com> wrote:

> Extend damon_test_split_at() to verify the 'age' field.
>
> Signed-off-by: Shu Anzai <shu17az@gmail.com>

Reviewed-by: SeongJae Park <sj@kernel.org>

> ---
> mm/damon/tests/core-kunit.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h
> index f59ae7ee19a0..88ec046f4942 100644
> --- a/mm/damon/tests/core-kunit.h
> +++ b/mm/damon/tests/core-kunit.h
> @@ -158,6 +158,7 @@ static void damon_test_split_at(struct kunit *test)
> r->nr_accesses_bp = 420000;
> r->nr_accesses = 42;
> r->last_nr_accesses = 15;
> + r->age = 10;
> damon_add_region(r, t);
> damon_split_region_at(t, r, 25);
> KUNIT_EXPECT_EQ(test, r->ar.start, 0ul);
> @@ -170,6 +171,7 @@ static void damon_test_split_at(struct kunit *test)
> KUNIT_EXPECT_EQ(test, r->nr_accesses_bp, r_new->nr_accesses_bp);
> KUNIT_EXPECT_EQ(test, r->nr_accesses, r_new->nr_accesses);
> KUNIT_EXPECT_EQ(test, r->last_nr_accesses, r_new->last_nr_accesses);
> + KUNIT_EXPECT_EQ(test, r->age, r_new->age);
>
> damon_free_target(t);
> }
> --
> 2.43.0

Thanks,
SJ