Re: [RFC PATCH 2/2] mm/damon/reclaim: avoid divide-by-zero in damon_reclaim_apply_parameters()
From: SeongJae Park
Date: Tue Aug 26 2025 - 10:48:45 EST
On Tue, 26 Aug 2025 11:36:53 +0800 Quanmin Yan <yanquanmin1@xxxxxxxxxx> wrote:
> When creating a new scheme of DAMON_RECLAIM, the calculation
> of 'min_age_region' uses 'aggr_interval' as the divisor, which
> may lead to division-by-zero errors. Fix it by directly returning
> -EINVAL when such a case occurs.
Nice catch, thank you for this patch!
>
> Fixes: f5a79d7c0c87 ("mm/damon: introduce struct damos_access_pattern")
Let's add Cc: stable@
> Signed-off-by: Quanmin Yan <yanquanmin1@xxxxxxxxxx>
Reviewed-by: SeongJae Park <sj@xxxxxxxxxx>
Thanks,
SJ
[...]