Re: [PATCH 09/12] mm/damon/tests/core-kunit: test damon_nr_samples_per_aggr()
From: SJ Park
Date: Wed Sep 02 2026 - 11:40:00 EST
On Wed, 2 Sep 2026 23:08:41 +0800 Kunwu Chan <kunwu.chan@xxxxxxxxx> wrote:
> On Tue, 1 Sep 2026 22:47:42 -0700 SJ Park <sj@xxxxxxxxxx> wrote:
[...]
> Both `sample_interval` and `aggr_interval` are zero here. Since
> `sample_interval` is the denominator in `damon_nr_samples_per_aggr()`,
> would it be better to keep `aggr_interval` non-zero when testing the
> zero `sample_interval` case?
>
> This would make the test explicitly cover the divide-by-zero protection.
> If the `aggr_interval == 0` behavior is also worth covering, perhaps it
> could be tested separately.
Thank you for your review and question, Kunwu!
Yes, that kind of additional test case would be nice. Please feel free to post
a patch if you'd like to! :) And no pressure, no rush. I will also consider
doing it myself if it seems you are not interested.
Thanks,
SJ
[...]