linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/14] mm/damon: remove damon_callback
@ 2025-07-12 19:50 SeongJae Park
  2025-07-12 19:50 ` [PATCH 01/14] mm/damon: accept parallel damon_call() requests SeongJae Park
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: SeongJae Park @ 2025-07-12 19:50 UTC (permalink / raw)
  To: Andrew Morton; +Cc: SeongJae Park, damon, kernel-team, linux-kernel, linux-mm

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/20250706200018.42704-1-sj@kernel.org)
- 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
-- 
2.39.5

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-07-12 19:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-12 19:50 [PATCH 00/14] mm/damon: remove damon_callback SeongJae Park
2025-07-12 19:50 ` [PATCH 01/14] mm/damon: accept parallel damon_call() requests SeongJae Park
2025-07-12 19:50 ` [PATCH 02/14] mm/damon/core: introduce repeat mode damon_call() SeongJae Park
2025-07-12 19:50 ` [PATCH 03/14] mm/damon/stat: use damon_call() repeat mode instead of damon_callback SeongJae Park
2025-07-12 19:50 ` [PATCH 04/14] mm/damon/reclaim: " SeongJae Park
2025-07-12 19:50 ` [PATCH 05/14] mm/damon/lru_sort: " SeongJae Park
2025-07-12 19:50 ` [PATCH 06/14] samples/damon/prcl: " SeongJae Park
2025-07-12 19:50 ` [PATCH 07/14] samples/damon/wsse: " SeongJae Park
2025-07-12 19:50 ` [PATCH 08/14] mm/damon/core: do not call ops.cleanup() when destroying targets SeongJae Park
2025-07-12 19:50 ` [PATCH 09/14] mm/damon/core: add cleanup_target() ops callback SeongJae Park
2025-07-12 19:50 ` [PATCH 10/14] mm/damon/vaddr: put pid in cleanup_target() SeongJae Park
2025-07-12 19:50 ` [PATCH 11/14] mm/damon/sysfs: remove damon_sysfs_destroy_targets() SeongJae Park
2025-07-12 19:50 ` [PATCH 12/14] mm/damon/core: destroy targets when kdamond_fn() finish SeongJae Park
2025-07-12 19:50 ` [PATCH 13/14] mm/damon/sysfs: remove damon_sysfs_before_terminate() SeongJae Park
2025-07-12 19:50 ` [PATCH 14/14] mm/damon/core: remove damon_callback SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).