Thread (15 messages) 15 messages, 3 authors, 22d ago

[RFC PATCH 4/9] mm/damon/core: use damos_quota_is_set() in damos_adjust_quota()

flat view
COLD22d

From: SJ Park <sj@kernel.org>
Date: 2026-09-12 20:08:23
Also in: damon, lkml
Subsystem: damon, memory management, the rest · Maintainers: SJ Park, Andrew Morton, Linus Torvalds

damos_adjust_quota() is manually checking if the user set the DAMOS
quota.  There is a dedicated helper, damos_quota_is_set(), for the
purpose.  Use the helper.

Signed-off-by: SJ Park <sj@kernel.org>
---
 mm/damon/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/damon/core.c b/mm/damon/core.c
index cf10f6d725c19..dd27068cb83e3 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -3344,7 +3344,7 @@ static void damos_adjust_quota(struct damon_ctx *c, struct damos *s)
 	unsigned long cumulated_sz, cached_esz;
 	unsigned int score, max_score = 0;
 
-	if (!quota->ms && !quota->sz && list_empty(&quota->goals))
+	if (!damos_quota_is_set(quota))
 		return;
 
 	/* First charge window */
-- 
2.47.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help