DAMON development mailing list
 help / color / mirror / Atom feed
* [PATCH 0/2] mm/damon/core: remove unused helper functions
@ 2026-07-22 11:33 Cheng-Han Wu
  2026-07-22 11:33 ` [PATCH 1/2] mm/damon/core: remove unused damon_targets_empty() Cheng-Han Wu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Cheng-Han Wu @ 2026-07-22 11:33 UTC (permalink / raw)
  To: SJ Park
  Cc: Andrew Morton, Shuah Khan, damon, linux-mm, linux-kernel,
	linux-kernel-mentees, Cheng-Han Wu

Both damon_targets_empty() and damon_nr_running_ctxs() have had no
in-tree users since commit 5ec4333b1967 ("mm/damon: remove DAMON
debugfs interface") removed their remaining callers.

Remove the unused declarations and definitions.

Tested with:
  make O=../linux-build-mm W=1 mm/damon

Cheng-Han Wu (2):
  mm/damon/core: remove unused damon_targets_empty()
  mm/damon/core: remove unused damon_nr_running_ctxs()

 include/linux/damon.h |  2 --
 mm/damon/core.c       | 19 -------------------
 2 files changed, 21 deletions(-)


base-commit: 5e0603ba185af6754422ad28b646798686b6caf6
-- 
2.52.0


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

* [PATCH 1/2] mm/damon/core: remove unused damon_targets_empty()
  2026-07-22 11:33 [PATCH 0/2] mm/damon/core: remove unused helper functions Cheng-Han Wu
@ 2026-07-22 11:33 ` Cheng-Han Wu
  2026-07-22 14:04   ` SJ Park
  2026-07-22 11:33 ` [PATCH 2/2] mm/damon/core: remove unused damon_nr_running_ctxs() Cheng-Han Wu
  2026-07-22 14:09 ` [PATCH 0/2] mm/damon/core: remove unused helper functions SJ Park
  2 siblings, 1 reply; 6+ messages in thread
From: Cheng-Han Wu @ 2026-07-22 11:33 UTC (permalink / raw)
  To: SJ Park
  Cc: Andrew Morton, Shuah Khan, damon, linux-mm, linux-kernel,
	linux-kernel-mentees, Cheng-Han Wu

damon_targets_empty() has had no in-tree users since commit
5ec4333b1967 ("mm/damon: remove DAMON debugfs interface") removed
its last caller.

Remove the unused declaration and definition.

Signed-off-by: Cheng-Han Wu <hank20010209@gmail.com>
---
 include/linux/damon.h | 1 -
 mm/damon/core.c       | 5 -----
 2 files changed, 6 deletions(-)

diff --git a/include/linux/damon.h b/include/linux/damon.h
index 0c8b7ddef9ab..8e5589ccf50f 100644
--- a/include/linux/damon.h
+++ b/include/linux/damon.h
@@ -1054,7 +1054,6 @@ int damos_commit_quota_goals(struct damos_quota *dst, struct damos_quota *src);
 
 struct damon_target *damon_new_target(void);
 void damon_add_target(struct damon_ctx *ctx, struct damon_target *t);
-bool damon_targets_empty(struct damon_ctx *ctx);
 void damon_free_target(struct damon_target *t);
 void damon_destroy_target(struct damon_target *t, struct damon_ctx *ctx);
 unsigned int damon_nr_regions(struct damon_target *t);
diff --git a/mm/damon/core.c b/mm/damon/core.c
index 644daf5a1656..da97b2dc39d1 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -795,11 +795,6 @@ void damon_add_target(struct damon_ctx *ctx, struct damon_target *t)
 	list_add_tail(&t->list, &ctx->adaptive_targets);
 }
 
-bool damon_targets_empty(struct damon_ctx *ctx)
-{
-	return list_empty(&ctx->adaptive_targets);
-}
-
 static void damon_del_target(struct damon_target *t)
 {
 	list_del(&t->list);
-- 
2.52.0


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

* [PATCH 2/2] mm/damon/core: remove unused damon_nr_running_ctxs()
  2026-07-22 11:33 [PATCH 0/2] mm/damon/core: remove unused helper functions Cheng-Han Wu
  2026-07-22 11:33 ` [PATCH 1/2] mm/damon/core: remove unused damon_targets_empty() Cheng-Han Wu
@ 2026-07-22 11:33 ` Cheng-Han Wu
  2026-07-22 14:05   ` SJ Park
  2026-07-22 14:09 ` [PATCH 0/2] mm/damon/core: remove unused helper functions SJ Park
  2 siblings, 1 reply; 6+ messages in thread
From: Cheng-Han Wu @ 2026-07-22 11:33 UTC (permalink / raw)
  To: SJ Park
  Cc: Andrew Morton, Shuah Khan, damon, linux-mm, linux-kernel,
	linux-kernel-mentees, Cheng-Han Wu

damon_nr_running_ctxs() has had no in-tree users since commit
5ec4333b1967 ("mm/damon: remove DAMON debugfs interface") removed
all of its callers.

Remove the unused declaration and definition.

Signed-off-by: Cheng-Han Wu <hank20010209@gmail.com>
---
 include/linux/damon.h |  1 -
 mm/damon/core.c       | 14 --------------
 2 files changed, 15 deletions(-)

diff --git a/include/linux/damon.h b/include/linux/damon.h
index 8e5589ccf50f..50659c9083a9 100644
--- a/include/linux/damon.h
+++ b/include/linux/damon.h
@@ -1064,7 +1064,6 @@ int damon_set_attrs(struct damon_ctx *ctx, struct damon_attrs *attrs);
 void damon_set_schemes(struct damon_ctx *ctx,
 			struct damos **schemes, ssize_t nr_schemes);
 int damon_commit_ctx(struct damon_ctx *old_ctx, struct damon_ctx *new_ctx);
-int damon_nr_running_ctxs(void);
 bool damon_is_registered_ops(enum damon_ops_id id);
 int damon_register_ops(struct damon_operations *ops);
 int damon_select_ops(struct damon_ctx *ctx, enum damon_ops_id id);
diff --git a/mm/damon/core.c b/mm/damon/core.c
index da97b2dc39d1..891f851bcbbf 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -1847,20 +1847,6 @@ int damon_commit_ctx(struct damon_ctx *dst, struct damon_ctx *src)
 	return err;
 }
 
-/**
- * damon_nr_running_ctxs() - Return number of currently running contexts.
- */
-int damon_nr_running_ctxs(void)
-{
-	int nr_ctxs;
-
-	mutex_lock(&damon_lock);
-	nr_ctxs = nr_running_ctxs;
-	mutex_unlock(&damon_lock);
-
-	return nr_ctxs;
-}
-
 /* Returns the size upper limit for each monitoring region */
 static unsigned long damon_region_sz_limit(struct damon_ctx *ctx)
 {
-- 
2.52.0


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

* Re: [PATCH 1/2] mm/damon/core: remove unused damon_targets_empty()
  2026-07-22 11:33 ` [PATCH 1/2] mm/damon/core: remove unused damon_targets_empty() Cheng-Han Wu
@ 2026-07-22 14:04   ` SJ Park
  0 siblings, 0 replies; 6+ messages in thread
From: SJ Park @ 2026-07-22 14:04 UTC (permalink / raw)
  To: Cheng-Han Wu
  Cc: SJ Park, Andrew Morton, Shuah Khan, damon, linux-mm, linux-kernel,
	linux-kernel-mentees

On Wed, 22 Jul 2026 19:33:37 +0800 Cheng-Han Wu <hank20010209@gmail.com> wrote:

> damon_targets_empty() has had no in-tree users since commit
> 5ec4333b1967 ("mm/damon: remove DAMON debugfs interface") removed
> its last caller.
> 
> Remove the unused declaration and definition.

Nice catch and cleanup, thank you!

> 
> Signed-off-by: Cheng-Han Wu <hank20010209@gmail.com>

Reviewed-by: SJ Park <sj@kernel.org>


Thanks,
SJ

[...]

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

* Re: [PATCH 2/2] mm/damon/core: remove unused damon_nr_running_ctxs()
  2026-07-22 11:33 ` [PATCH 2/2] mm/damon/core: remove unused damon_nr_running_ctxs() Cheng-Han Wu
@ 2026-07-22 14:05   ` SJ Park
  0 siblings, 0 replies; 6+ messages in thread
From: SJ Park @ 2026-07-22 14:05 UTC (permalink / raw)
  To: Cheng-Han Wu
  Cc: SJ Park, Andrew Morton, Shuah Khan, damon, linux-mm, linux-kernel,
	linux-kernel-mentees

On Wed, 22 Jul 2026 19:33:38 +0800 Cheng-Han Wu <hank20010209@gmail.com> wrote:

> damon_nr_running_ctxs() has had no in-tree users since commit
> 5ec4333b1967 ("mm/damon: remove DAMON debugfs interface") removed
> all of its callers.
> 
> Remove the unused declaration and definition.

Nice catch and cleanup, thank you!

> 
> Signed-off-by: Cheng-Han Wu <hank20010209@gmail.com>

Reviewed-by: SJ Park <sj@kernel.org>


Thanks,
SJ

[...]

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

* Re: [PATCH 0/2] mm/damon/core: remove unused helper functions
  2026-07-22 11:33 [PATCH 0/2] mm/damon/core: remove unused helper functions Cheng-Han Wu
  2026-07-22 11:33 ` [PATCH 1/2] mm/damon/core: remove unused damon_targets_empty() Cheng-Han Wu
  2026-07-22 11:33 ` [PATCH 2/2] mm/damon/core: remove unused damon_nr_running_ctxs() Cheng-Han Wu
@ 2026-07-22 14:09 ` SJ Park
  2 siblings, 0 replies; 6+ messages in thread
From: SJ Park @ 2026-07-22 14:09 UTC (permalink / raw)
  To: Cheng-Han Wu
  Cc: SJ Park, Andrew Morton, Shuah Khan, damon, linux-mm, linux-kernel,
	linux-kernel-mentees

On Wed, 22 Jul 2026 19:33:36 +0800 Cheng-Han Wu <hank20010209@gmail.com> wrote:

> Both damon_targets_empty() and damon_nr_running_ctxs() have had no
> in-tree users since commit 5ec4333b1967 ("mm/damon: remove DAMON
> debugfs interface") removed their remaining callers.
> 
> Remove the unused declarations and definitions.
> 
> Tested with:
>   make O=../linux-build-mm W=1 mm/damon

Nice catch and cleanup, thnk you!


I applied  this patch to damon/next [1] tree.  We are now quite close to next
merge window.  We (mm community) want to focus on making mm.git more stabilized
and therefore ready for the next merge window, rather than adding more changes
that are not really urgent.  I understand this series is not really urgent.
Hence, Andrew might not add this patch until next -rc1 release.  In the case, I
will request adding this to mm.git after next -rc1 release.  So, no action from
your side is needed for now.  Let me know if you think this is really  urgent.

[1] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees


Thanks,
SJ

[...]

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

end of thread, other threads:[~2026-07-22 14:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-22 11:33 [PATCH 0/2] mm/damon/core: remove unused helper functions Cheng-Han Wu
2026-07-22 11:33 ` [PATCH 1/2] mm/damon/core: remove unused damon_targets_empty() Cheng-Han Wu
2026-07-22 14:04   ` SJ Park
2026-07-22 11:33 ` [PATCH 2/2] mm/damon/core: remove unused damon_nr_running_ctxs() Cheng-Han Wu
2026-07-22 14:05   ` SJ Park
2026-07-22 14:09 ` [PATCH 0/2] mm/damon/core: remove unused helper functions SJ Park

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