linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] mm/damon: define and use DAMON initialization check function
@ 2025-09-16  3:35 SeongJae Park
  2025-09-16  3:35 ` [PATCH 1/7] mm/damon/core: implement damon_initialized() function SeongJae Park
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: SeongJae Park @ 2025-09-16  3:35 UTC (permalink / raw)
  To: Andrew Morton; +Cc: SeongJae Park, damon, kernel-team, linux-kernel, linux-mm

If DAMON is tried to be used by its API callers when it is not yet
successfully initialized, the callers could be crashed.  Such issues
actually happened and were fixed [1].  DAMON API callers are therefore
having their own hacks for seeing if it is safe to use DAMON or not.
Those built on an untreliable assumption that DAMON should be ready to
be used on module init time.  DAMON initialization could fail if
KMEM_CACHE() fails, though.  Also those are basically duplications that
make their maintenance difficult.

Make it reliable and easy to maintain, by implementing a new DAMON core
layer API function for seeing if DAMON is ready to be used or not, and
replacing the hacks of DAMON API callers with the new core layer
function.

Changes from RFC
(https://lore.kernel.org/20250912023946.62337-1-sj@kernel.org)
- Rebase on latest mm-new

[1] https://lore.kernel.org/20250909022238.2989-1-sj@kernel.org

SeongJae Park (7):
  mm/damon/core: implement damon_initialized() function
  mm/damon/stat: use damon_initialized()
  mm/damon/reclaim: use damon_initialized()
  mm/damon/lru_sort: use damon_initialized()
  samples/damon/wsse: use damon_initialized()
  samples/damon/prcl: use damon_initialized()
  samples/damon/mtier: use damon_initialized()

 include/linux/damon.h |  1 +
 mm/damon/core.c       | 10 ++++++++++
 mm/damon/lru_sort.c   |  9 +++++++--
 mm/damon/reclaim.c    |  9 +++++++--
 mm/damon/stat.c       | 10 ++++++----
 samples/damon/mtier.c | 11 +++++++----
 samples/damon/prcl.c  | 11 +++++++----
 samples/damon/wsse.c  | 15 +++++++++------
 8 files changed, 54 insertions(+), 22 deletions(-)


base-commit: b6a9d79765ceb52c8889fd24e1ff3169cc12c80b
-- 
2.39.5


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

end of thread, other threads:[~2025-09-16  5:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-16  3:35 [PATCH 0/7] mm/damon: define and use DAMON initialization check function SeongJae Park
2025-09-16  3:35 ` [PATCH 1/7] mm/damon/core: implement damon_initialized() function SeongJae Park
2025-09-16  3:35 ` [PATCH 2/7] mm/damon/stat: use damon_initialized() SeongJae Park
2025-09-16  3:35 ` [PATCH 3/7] mm/damon/reclaim: " SeongJae Park
2025-09-16  3:35 ` [PATCH 4/7] mm/damon/lru_sort: " SeongJae Park
2025-09-16  3:35 ` [PATCH 5/7] samples/damon/wsse: " SeongJae Park
2025-09-16  3:35 ` [PATCH 6/7] samples/damon/prcl: " SeongJae Park
2025-09-16  3:35 ` [PATCH 7/7] samples/damon/mtier: " SeongJae Park
2025-09-16  4:33 ` [PATCH 0/7] mm/damon: define and use DAMON initialization check function Andrew Morton
2025-09-16  5:54   ` SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox