Skip to content

mm/damon: remove damon_callback

SeongJae Park damon linux-mm lkml 1 version Applied

Status from this message: [merged mm-stable] mm-damon-core-remove-damon_callback.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 0 repliesApplied 14/14

Patches in v1 All 14 applied

#Subject and filesSizeRepliesApplied
1/14mm/damon: accept parallel damon_call() requestsinclude/linux/damon.h mm/damon/core.c+30 -260 repliesApplied
2/14mm/damon/core: introduce repeat mode damon_call()include/linux/damon.h mm/damon/core.c+22 -50 repliesApplied
3/14mm/damon/stat: use damon_call() repeat mode instead of damon_callbackmm/damon/stat.c+14 -30 repliesApplied
4/14mm/damon/reclaim: use damon_call() repeat mode instead of damon_callbackmm/damon/reclaim.c+31 -310 repliesApplied
5/14mm/damon/lru_sort: use damon_call() repeat mode instead of damon_callbackmm/damon/lru_sort.c+35 -350 repliesApplied
6/14samples/damon/prcl: use damon_call() repeat mode instead of damon_callbacksamples/damon/prcl.c+14 -40 repliesApplied
7/14samples/damon/wsse: use damon_call() repeat mode instead of damon_callbacksamples/damon/wsse.c+13 -30 repliesApplied
8/14mm/damon/core: do not call ops.cleanup() when destroying targetsmm/damon/core.c+0 -50 repliesApplied
9/14mm/damon/core: add cleanup_target() ops callbackinclude/linux/damon.h mm/damon/core.c mm/damon/sysfs.c +2 more+16 -100 repliesApplied
10/14mm/damon/vaddr: put pid in cleanup_target()mm/damon/core.c mm/damon/sysfs.c mm/damon/vaddr.c +2 more+8 -140 repliesApplied
11/14mm/damon/sysfs: remove damon_sysfs_destroy_targets()mm/damon/sysfs.c+3 -200 repliesApplied
12/14mm/damon/core: destroy targets when kdamond_fn() finishmm/damon/core.c+1 -00 repliesApplied
13/14mm/damon/sysfs: remove damon_sysfs_before_terminate()mm/damon/sysfs.c+0 -120 repliesApplied
14/14mm/damon/core: remove damon_callbackinclude/linux/damon.h mm/damon/core.c+8 -490 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/14] mm/damon: remove damon_callback

damon_callback was the only way for communicating with DAMON for contexts running on its worker thread. The interface is flexible and simple. But as DAMON evolves with more features, damon_callback has become somewhat too old. With runtime parameters update, for example, its lack of synchronization support was found to be inconvenient. Arguably it is also not easy to use correctly since the callers should understand when each callback is called, and implication of the return values from the callbacks.

To replace it, damon_call() and damos_walk() are introduced. And those replaced a few damon_callback use cases. Some use cases of damon_callback such as parallel or repetitive DAMON internal data reading and additional cleanups cannot simply be replaced by damon_call() and damos_walk(), though.

To allow those replaceable, extend damon_call() for parallel and/or repeated callbacks and modify the core/ops layers for additional resources cleanup. With the updates, replace the remaining damon_callback usages and finally say goodbye to damon_callback.

Changes from RFC
(https://lore.kernel.org/[email protected])
- Fix wrong return from loop that prevents repeat mode damon_call().
- Remove unnecessary put_pid() from DAMON sample modules.
- Rebase to latest mm-new

SeongJae Park (14):
mm/damon: accept parallel damon_call() requests mm/damon/core: introduce repeat mode damon_call() mm/damon/stat: use damon_call() repeat mode instead of damon_callback mm/damon/reclaim: use damon_call() repeat mode instead of
damon_callback
mm/damon/lru_sort: use damon_call() repeat mode instead of
damon_callback
samples/damon/prcl: use damon_call() repeat mode instead of
damon_callback
samples/damon/wsse: use damon_call() repeat mode instead of
damon_callback
mm/damon/core: do not call ops.cleanup() when destroying targets mm/damon/core: add cleanup_target() ops callback mm/damon/vaddr: put pid in cleanup_target() mm/damon/sysfs: remove damon_sysfs_destroy_targets() mm/damon/core: destroy targets when kdamond_fn() finish mm/damon/sysfs: remove damon_sysfs_before_terminate() mm/damon/core: remove damon_callback

 include/linux/damon.h        |  44 ++++---------
 mm/damon/core.c              | 116 ++++++++++++++++++-----------------
 mm/damon/lru_sort.c          |  70 ++++++++++-----------
 mm/damon/reclaim.c           |  62 +++++++++----------
 mm/damon/stat.c              |  17 ++++-
 mm/damon/sysfs.c             |  41 +------------
 mm/damon/tests/core-kunit.h  |   4 +-
 mm/damon/tests/vaddr-kunit.h |   2 +-
 mm/damon/vaddr.c             |   6 ++
 samples/damon/prcl.c         |  20 ++++--
 samples/damon/wsse.c         |  18 ++++--
 11 files changed, 189 insertions(+), 211 deletions(-)

base-commit: 2c92772b92095b79ca713f215b192b555e41f72e

Signature · 1 line
2.39.5