[PATCH] mm/damon/core: always return false when esz is zero
From: Liew Rui Yan
Date: Tue Sep 01 2026 - 07:06:04 EST
After setting goal_tuner to 'temporal', if the goal is achieved,
quota->esz will be set to zero. In this case, damos_quota_is_full()
will always return true, even if no regions have been tried at all.
This causes qt_exceeds to increase unexpectedly.
Fix it by always returning false when quota->esz is zero.
Fixes: c7ec7d5f6b3d ("mm/damon/core: handle <min_region_sz remaining quota as empty")
Cc: <stable@xxxxxxxxxxxxxxx> # v7.2.x
Signed-off-by: Liew Rui Yan <aethernet65535@xxxxxxxxx>
---
mm/damon/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/damon/core.c b/mm/damon/core.c
index 644daf5a1656..53cf32f1d515 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -2560,6 +2560,8 @@ static bool damos_quota_is_full(struct damos_quota *quota,
{
if (!damos_quota_is_set(quota))
return false;
+ if (!quota->esz)
+ return false;
if (quota->charged_sz >= quota->esz)
return true;
/*
--
2.55.0