[PATCH 15/19] mm/damon/core: implement damon_has_probe_weight()

From: SJ Park

Date: Fri Jul 10 2026 - 09:56:12 EST


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.

Signed-off-by: SJ Park <sj@xxxxxxxxxx>
---
mm/damon/core.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/mm/damon/core.c b/mm/damon/core.c
index 91964336ce31e..806a67d02a6e9 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;
}

--
2.47.3