DAMON development mailing list
 help / color / mirror / Atom feed
* [PATCH v2 0/2] mm/damon/core: remove unused helper functions
@ 2026-08-31 14:57 SJ Park
  2026-08-31 14:57 ` [PATCH v2 1/2] mm/damon/core: remove unused damon_targets_empty() SJ Park
  2026-08-31 14:57 ` [PATCH v2 2/2] mm/damon/core: remove unused damon_nr_running_ctxs() SJ Park
  0 siblings, 2 replies; 5+ messages in thread
From: SJ Park @ 2026-08-31 14:57 UTC (permalink / raw)
  To: Andrew Morton; +Cc: SJ Park, damon, linux-kernel, linux-mm

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

Changes from v1
- v1: https://lore.kernel.org/20260722113338.302603-1-hank20010209@gmail.com
- Collect R-b: from SJ.
- Rebase to latest mm-new.

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

SJ Park (1):
  mm/damon/core: remove unused damon_targets_empty()

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


base-commit: 1faa74d984626dfc33182c71145f2ccda03179e8
-- 
2.47.3

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

* [PATCH v2 1/2] mm/damon/core: remove unused damon_targets_empty()
  2026-08-31 14:57 [PATCH v2 0/2] mm/damon/core: remove unused helper functions SJ Park
@ 2026-08-31 14:57 ` SJ Park
  2026-08-31 23:19   ` Andrew Morton
  2026-08-31 14:57 ` [PATCH v2 2/2] mm/damon/core: remove unused damon_nr_running_ctxs() SJ Park
  1 sibling, 1 reply; 5+ messages in thread
From: SJ Park @ 2026-08-31 14:57 UTC (permalink / raw)
  To: Andrew Morton; +Cc: SJ Park, damon, linux-kernel, linux-mm, 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>
Reviewed-by: SJ Park <sj@kernel.org>
Signed-off-by: SJ Park <sj@kernel.org>
---
 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 310509455db13..9835b864a8db9 100644
--- a/include/linux/damon.h
+++ b/include/linux/damon.h
@@ -1056,7 +1056,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);
 int damon_set_target_pid(struct damon_target *t, int pid);
 void damon_free_target(struct damon_target *t);
 void damon_destroy_target(struct damon_target *t, struct damon_ctx *ctx);
diff --git a/mm/damon/core.c b/mm/damon/core.c
index 3fa1b096c8330..043eb38de5fd3 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -798,11 +798,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);
-}
-
 /*
  * Assign the struct pid of the given pid number to the given target.
  */
-- 
2.47.3

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

* [PATCH v2 2/2] mm/damon/core: remove unused damon_nr_running_ctxs()
  2026-08-31 14:57 [PATCH v2 0/2] mm/damon/core: remove unused helper functions SJ Park
  2026-08-31 14:57 ` [PATCH v2 1/2] mm/damon/core: remove unused damon_targets_empty() SJ Park
@ 2026-08-31 14:57 ` SJ Park
  1 sibling, 0 replies; 5+ messages in thread
From: SJ Park @ 2026-08-31 14:57 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Cheng-Han Wu, SJ Park, damon, linux-kernel, linux-mm

From: Cheng-Han Wu <hank20010209@gmail.com>

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>
Reviewed-by: SJ Park <sj@kernel.org>
Signed-off-by: SJ Park <sj@kernel.org>
---
 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 9835b864a8db9..6842a336291e8 100644
--- a/include/linux/damon.h
+++ b/include/linux/damon.h
@@ -1067,7 +1067,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 043eb38de5fd3..53c3f97e3f126 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -1866,20 +1866,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.47.3

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

* Re: [PATCH v2 1/2] mm/damon/core: remove unused damon_targets_empty()
  2026-08-31 14:57 ` [PATCH v2 1/2] mm/damon/core: remove unused damon_targets_empty() SJ Park
@ 2026-08-31 23:19   ` Andrew Morton
  2026-09-01  0:42     ` SJ Park
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2026-08-31 23:19 UTC (permalink / raw)
  To: SJ Park; +Cc: damon, linux-kernel, linux-mm, Cheng-Han Wu

On Mon, 31 Aug 2026 07:57:21 -0700 SJ Park <sj@kernel.org> 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.
> 
> Signed-off-by: Cheng-Han Wu <hank20010209@gmail.com>

I assumed that a From:Cheng-Han was intended in this patch.

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


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

* Re: [PATCH v2 1/2] mm/damon/core: remove unused damon_targets_empty()
  2026-08-31 23:19   ` Andrew Morton
@ 2026-09-01  0:42     ` SJ Park
  0 siblings, 0 replies; 5+ messages in thread
From: SJ Park @ 2026-09-01  0:42 UTC (permalink / raw)
  To: Andrew Morton; +Cc: SJ Park, damon, linux-kernel, linux-mm, Cheng-Han Wu

On Mon, 31 Aug 2026 16:19:07 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:

> On Mon, 31 Aug 2026 07:57:21 -0700 SJ Park <sj@kernel.org> 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.
> > 
> > Signed-off-by: Cheng-Han Wu <hank20010209@gmail.com>
> 
> I assumed that a From:Cheng-Han was intended in this patch.

You're correct.  Seems I mistakenly dropped it while resolving a conflict.  I
will keep this in my mind to not make same mistake next time.  I found you
already fixed this when you applying this to mm-new.  Appreicate!

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


Thanks,
SJ

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

end of thread, other threads:[~2026-09-01  0:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 14:57 [PATCH v2 0/2] mm/damon/core: remove unused helper functions SJ Park
2026-08-31 14:57 ` [PATCH v2 1/2] mm/damon/core: remove unused damon_targets_empty() SJ Park
2026-08-31 23:19   ` Andrew Morton
2026-09-01  0:42     ` SJ Park
2026-08-31 14:57 ` [PATCH v2 2/2] mm/damon/core: remove unused damon_nr_running_ctxs() SJ Park

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