* [PATCH] mm/damon/core: always return false when esz is zero
@ 2026-09-01 10:59 Liew Rui Yan
0 siblings, 0 replies; only message in thread
From: Liew Rui Yan @ 2026-09-01 10:59 UTC (permalink / raw)
To: SJ Park; +Cc: Andrew Morton, damon, linux-mm, linux-kernel, Liew Rui Yan,
stable
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@vger.kernel.org> # v7.2.x
Signed-off-by: Liew Rui Yan <aethernet65535@gmail.com>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-01 10:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01 10:59 [PATCH] mm/damon/core: always return false when esz is zero Liew Rui Yan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox