]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/damon/core: introduce damon_call()
authorSeongJae Park <sj@kernel.org>
Fri, 3 Jan 2025 17:43:53 +0000 (09:43 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 26 Jan 2025 04:22:25 +0000 (20:22 -0800)
commit42b7491af14cbba2393329ce43d508a957bd94fa
tree477779f78a06817af394b682226bfe268e462994
parent0f3e40eb5ec17949ad6053ed057735e1a33079f7
mm/damon/core: introduce damon_call()

Introduce a new DAMON core API function, damon_call().  It aims to replace
some damon_callback usages that access damon_ctx of ongoing kdamond with
additional synchronizations.  It receives a function pointer, let the
parallel kdamond invokes the function, and returns after the invocation is
finished, or canceled due to some races.

kdamond invokes the function inside the main loop after sampling is done.
If it is deactivated by DAMOS watermarks or already out of the main loop,
mark the request as canceled so that damon_call() can wakeup and return.

Link: https://lkml.kernel.org/r/20250103174400.54890-4-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/damon.h
mm/damon/core.c