mm/damon/core: introduce repeat mode damon_call()
authorSeongJae Park <sj@kernel.org>
Sat, 12 Jul 2025 19:50:04 +0000 (12:50 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 20 Jul 2025 01:59:54 +0000 (18:59 -0700)
commit43df7676e5508895c33b846d37cff9cf3b52674c
tree8cdbbdb930cc044b7ce9f37c4923af9598e40cae
parent004ded6bee11b8ed463cdc54b89a4390f4b64f6d
mm/damon/core: introduce repeat mode damon_call()

damon_call() can be useful for reading or writing DAMON internal data for
one time.  A common pattern of DAMON core usage from DAMON modules is
doing such reads and writes repeatedly, for example, to periodically
update the DAMOS stats.  To do that with damon_call(), callers should call
damon_call() repeatedly, with their own delay loop.  Each caller doing
that is repetitive.  Introduce a repeat mode damon_call().  Callers can
use the mode by setting a new field in damon_call_control.  If the mode is
turned on, damon_call() returns success immediately, and DAMON repeats
invoking the callback function inside the kdamond main loop.

Link: https://lkml.kernel.org/r/20250712195016.151108-3-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/damon.h
mm/damon/core.c