On 32-bit systems, the throughput calculation in function damos_set_effective_quota() is prone to unnecessary multiplication overflow. Using mult_frac() to fix it. Signed-off-by: Quanmin Yan --- mm/damon/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index 980e271e42e9..38b5f842ef30 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -2102,8 +2102,8 @@ static void damos_set_effective_quota(struct damos_quota *quota) if (quota->ms) { if (quota->total_charged_ns) - throughput = quota->total_charged_sz * 1000000 / - quota->total_charged_ns; + throughput = mult_frac(quota->total_charged_sz, 1000000, + quota->total_charged_ns); else throughput = PAGE_SIZE * 1024; esz = min(throughput * quota->ms, esz); -- 2.43.0