From 8d5e0ebac9e730d25f1657ffb9f5ae98b57164f6 Mon Sep 17 00:00:00 2001 From: SJ Park Date: Fri, 10 Jul 2026 06:46:44 -0700 Subject: [PATCH] mm/damon/core: implement damon_has_probe_weight() DAMON monitors only data attributes when probe weights are set. However, the function for detecting it is intentionally returning false always. The intention was to make changes for complete support of the mode in a safe and incremental way. Now all the building blocks are made. Complete the mode detection function so that the mode can really start working. Link: https://lore.kernel.org/20260710134651.18084-16-sj@kernel.org Signed-off-by: SJ Park Cc: David Hildenbrand Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- mm/damon/core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/damon/core.c b/mm/damon/core.c index 91964336ce31..806a67d02a6e 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -211,6 +211,12 @@ static struct damon_probe *damon_nth_probe(int n, struct damon_ctx *ctx) static bool damon_has_probe_weights(struct damon_ctx *c) { + struct damon_probe *p; + + damon_for_each_probe(p, c) { + if (p->weight) + return true; + } return false; }