[PATCH 0/3] mm/damon/core: small cleanups

From: Josh Law

Date: Wed Mar 25 2026 - 03:40:48 EST


Three small cleanups for mm/damon/core.c:

1. Extract duplicated scheme-index-finding loops into a helper.

2. Use the already-maintained damon_nr_regions() instead of walking the
region list to count in damon_commit_target_regions().

3. Move the static last_nr_regions variable in kdamond_split_regions()
into struct damon_ctx so each kdamond tracks its own state.

Josh Law (3):
mm/damon/core: deduplicate scheme index lookup into helper
mm/damon/core: use damon_nr_regions() in damon_commit_target_regions()
mm/damon/core: move last_nr_regions from static local to damon_ctx

include/linux/damon.h | 2 ++
mm/damon/core.c | 54 ++++++++++++++++++-------------------------
2 files changed, 24 insertions(+), 32 deletions(-)

--
2.34.1