]> www.infradead.org Git - users/dwmw2/linux.git/commit
mm/damon/core: implement damos_walk()
authorSeongJae Park <sj@kernel.org>
Fri, 3 Jan 2025 17:43:57 +0000 (09:43 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 26 Jan 2025 04:22:25 +0000 (20:22 -0800)
commitbf0eaba0ff9c9c8e6fd58ddfa1a8b6df4b813f61
tree495a9d5462aa5533ddb6c8b75014d3a8e6ccbbde
parent9a5aa3349b9428ae451b22c331d0d9a9cfc7ac90
mm/damon/core: implement damos_walk()

Introduce a new core layer interface, damos_walk().  It aims to replace
some damon_callback usages that access DAMOS schemes applied regions of
ongoing kdamond with additional synchronizations.  It receives a function
pointer and asks kdamond to invoke it for any region that it tried to
apply any DAMOS action within one scheme apply interval for every scheme
of it.  The function further waits until the kdamond finishes the
invocations for every scheme, or cancels the request, and returns.

The kdamond invokes the function as requested within the main loop.  If it
is deactivated by DAMOS watermarks or going out of the main loop, it marks
the request as canceled, so that damos_walk() can wakeup and return.

Link: https://lkml.kernel.org/r/20250103174400.54890-8-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