On Tue,  1 Sep 2026 22:47:41 -0700 SJ Park <[email protected]> wrote:

> Commit 954157679ec3 ("mm/damon/core: disallow overlapping input ranges
> for damon_set_regions()") disallowed passing overlapping input ranges to
> damon_set_regions().  Add a kunit test case for the overlapping input.
> 
> Signed-off-by: SJ Park <[email protected]>
> ---
>  mm/damon/tests/core-kunit.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h
> index 3cbbbcbfbef8f..a4164ac489a61 100644
> --- a/mm/damon/tests/core-kunit.h
> +++ b/mm/damon/tests/core-kunit.h
> @@ -612,6 +612,17 @@ static void damon_test_set_regions(struct kunit *test)
>                       {.start = 42, .end = 21},
>                       }, 1, 1,
>                       (struct damon_addr_range[]){}, 0, -EINVAL);
> +     /*
> +      * Regions resulting in same region after alignment should return
> +      * -EINVAL.
> +      */
> +     damon_test_set_regions_for(test,
> +                     (struct damon_addr_range[]){}, 0,
> +                     (struct damon_addr_range[]){
> +                     {.start = 10, .end = 20},
> +                     {.start = 20, .end = 30},
> +                     }, 2, 4096,
> +                     (struct damon_addr_range[]){}, 0, -EINVAL);
>  }
>  
>  static void damon_test_update_monitoring_result(struct kunit *test)
> -- 
> 2.47.3
> 

Hi SJ,

I reviewed patches 6-8. The test helper extension and the added
error cases look correct to me, including the overlap case after
range alignment.

Reviewed-by: Kunwu Chan <[email protected]>

Thanks,
Kunwu


Sent using hkml (https://github.com/sjp38/hackermail)

Reply via email to