When a DAMON context is configured with data attribute probe weights, it runs in attributes only monitoring mode. In the mode, the traditional page idleness based access monitoring is skipped. Users could manually do effectively the same thing in more flexible ways. They can use a set_pgidle probe prep and a pgidle_unset probe filter, with flexible setup of additional probes. The API callers should use the probe_hits instead of the traditional access frequency counter (nr_acceses), though. Some callers such as DAMOS quota region prioritization score logic would need to be aware of the mode. There is no core API for knowing if it is in the mode, though. Expose damon_has_probe_weights(), which is effectively working for the purpose, to DAMON core API callers. Signed-off-by: SJ Park --- include/linux/damon.h | 1 + mm/damon/core.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index 45c82f536da5..99f57add0106 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -1195,6 +1195,7 @@ bool damon_initialized(void); int damon_start(struct damon_ctx **ctxs, int nr_ctxs, bool exclusive); void damon_stop(struct damon_ctx **ctxs, int nr_ctxs); bool damon_is_running(struct damon_ctx *ctx); +bool damon_has_probe_weights(struct damon_ctx *ctx); int damon_kdamond_pid(struct damon_ctx *ctx); int damon_call(struct damon_ctx *ctx, struct damon_call_control *control); diff --git a/mm/damon/core.c b/mm/damon/core.c index 5eac19ed99b1..96a95f06eb73 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -271,7 +271,7 @@ static struct damon_probe *damon_nth_probe(int n, struct damon_ctx *ctx) return NULL; } -static bool damon_has_probe_weights(struct damon_ctx *c) +bool damon_has_probe_weights(struct damon_ctx *c) { struct damon_probe *p; -- 2.47.3