[PATCH 1/4] mm/damon/core: skip quota score setup when the quota is full
From: SJ Park
Date: Mon Sep 21 2026 - 12:44:19 EST
From: Liew Rui Yan <aethernet65535@xxxxxxxxx>
In damos_adjust_quota(), the quota could already be full.
In this situation, damos_adjust_quota() will still calculates
quota->min_score. However, this min_score will not be used in this
window, because in damon_do_apply_schemes(), damos_quota_is_full() will
always returns true, preventing the scheme from being applied to any
region.
Therefore, add a short circuit for 'esz < min_region_sz' schemes to
early return from damos_adjust_quota() before calculating min_score.
Signed-off-by: Liew Rui Yan <aethernet65535@xxxxxxxxx>
Reviewed-by: SJ Park <sj@xxxxxxxxxx>
Signed-off-by: SJ Park <sj@xxxxxxxxxx>
---
Changes from v1
- v1: https://lore.kernel.org/20260913110407.32558-1-aethernet65535@xxxxxxxxx
- Collect R-b: from SJ.
- Rebase to the latest mm-new.
mm/damon/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/damon/core.c b/mm/damon/core.c
index 2258b72da7a7..98c767b9e6ef 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -3368,6 +3368,8 @@ static void damos_adjust_quota(struct damon_ctx *c, struct damos *s)
damos_trace_esz(c, s, quota);
}
+ if (damos_quota_is_full(quota, c->min_region_sz))
+ return;
if (!c->ops.get_scheme_score)
return;
--
2.47.3