]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/damon/sysfs: handle commit command using damon_call()
authorSeongJae Park <sj@kernel.org>
Thu, 6 Mar 2025 17:58:59 +0000 (09:58 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 18 Mar 2025 05:06:54 +0000 (22:06 -0700)
commit3301f1861d34f53911a30a8f5f41b9141bd8ed39
tree5aad42b40cb2b54937fe63fca9005066b99674cf
parent258d941e5877f5fd40d5e636540c0a00458b8825
mm/damon/sysfs: handle commit command using damon_call()

DAMON sysfs interface is using damon_callback->after_aggregation hook with
its self-implemented synchronization mechanism for the hook.  It is
inefficient, complicated, and take up to one aggregation interval to
complete, which can be long on some configs.

Use damon_call() instead.  It provides a synchronization mechanism that
built inside DAMON's core layer, so more efficient than DAMON sysfs
interface's own one.  Also it isolates the implementation inside the core
layer, and hence it makes the code easier to maintain.  Finally, it takes
up to one sampling interval, which is much shorter than the aggregation
interval in common setups.

Link: https://lkml.kernel.org/r/20250306175908.66300-5-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/sysfs.c