[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250912023946.62337-1-sj@kernel.org>
Date: Thu, 11 Sep 2025 19:39:39 -0700
From: SeongJae Park <sj@...nel.org>
To:
Cc: SeongJae Park <sj@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
damon@...ts.linux.dev,
kernel-team@...a.com,
linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Subject: [RFC PATCH 0/7] mm/damon: define and use DAMON initialization check function
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.
[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: f115189b48629e7a8aa707112190b7ccf9928d6b
--
2.39.5
Powered by blists - more mailing lists