Skip to contentSkip to conversation

mm/damon/api: remove unused NR_DAMOS_* enumerators

PATCH In review Zenghui Yu 3 participants 5 messages Sep 20

Subsystems (2)
lore
Share & tools
lore

Zenghui Yu

author
#0 lore raw

PATCH 1/1 mm/damon/api: remove unused NR_DAMOS_* enumerators

From: "Zenghui Yu (Huawei)" <[email protected]>

NR_DAMOS_ACTIONS, NR_DAMOS_QUOTA_GOAL_METRICS, and NR_DAMOS_WMARK_METRICS are not referenced by any code. Remove them.

They can be reintroduced if a real user comes up.

---
 include/linux/damon.h | 8 --------
 1 file changed, 8 deletions(-)
include/linux/damon.h +0 -8
index 836353c4ab9a..6258ef8be764 100644
@@ -117,7 +117,6 @@ struct damon_target {
  * @DAMOS_MIGRATE_HOT:  Migrate the regions prioritizing warmer regions.
  * @DAMOS_MIGRATE_COLD:	Migrate the regions prioritizing colder regions.
  * @DAMOS_STAT:		Do nothing but count the stat.
- * @NR_DAMOS_ACTIONS:	Total number of DAMOS actions
  *
  * The support of each action is up to running &struct damon_operations.
  * Refer to 'Operation Action' section of Documentation/mm/damon/design.rst for
@@ -137,7 +136,6 @@ enum damos_action {
 	DAMOS_MIGRATE_HOT,
 	DAMOS_MIGRATE_COLD,
 	DAMOS_STAT,		/* Do nothing but only record the stat */
-	NR_DAMOS_ACTIONS,
 };
 
 /**
@@ -154,9 +152,6 @@ enum damos_action {
  * @DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP:	Scheme-eligible memory ratio of a
  *					node in basis points (0-10000).
  * @DAMOS_QUOTA_HUGEPAGE_MEM_BP:	Huge page to total used memory ratio.
- * @NR_DAMOS_QUOTA_GOAL_METRICS:	Number of DAMOS quota goal metrics.
- *
- * Metrics equal to larger than @NR_DAMOS_QUOTA_GOAL_METRICS are unsupported.
  */
 enum damos_quota_goal_metric {
 	DAMOS_QUOTA_USER_INPUT,
@@ -169,7 +164,6 @@ enum damos_quota_goal_metric {
 	DAMOS_QUOTA_INACTIVE_MEM_BP,
 	DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP,
 	DAMOS_QUOTA_HUGEPAGE_MEM_BP,
-	NR_DAMOS_QUOTA_GOAL_METRICS,
 };
 
 /**
@@ -313,12 +307,10 @@ struct damos_quota {
  *
  * @DAMOS_WMARK_NONE:		Ignore the watermarks of the given scheme.
  * @DAMOS_WMARK_FREE_MEM_RATE:	Free memory rate of the system in [0,1000].
- * @NR_DAMOS_WMARK_METRICS:	Total number of DAMOS watermark metrics
  */
 enum damos_wmark_metric {
 	DAMOS_WMARK_NONE,
 	DAMOS_WMARK_FREE_MEM_RATE,
-	NR_DAMOS_WMARK_METRICS,
 };
 
 /**
Signature · 1 line
2.53.0
#1 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 8 lines

From: "Zenghui Yu (Huawei)" <[email protected]>

NR_DAMOS_ACTIONS, NR_DAMOS_QUOTA_GOAL_METRICS, and NR_DAMOS_WMARK_METRICS are not referenced by any code. Remove them.

They can be reintroduced if a real user comes up.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Zenghui Yu
Quoted 3 lines · On Sun, 20 Sep 2026 09:20:28 +0800 Zenghui Yu <[email protected]> wrote:

From: "Zenghui Yu (Huawei)" <[email protected]>

NR_DAMOS_ACTIONS, NR_DAMOS_QUOTA_GOAL_METRICS, and NR_DAMOS_WMARK_METRICS

More than 72 columns.

Quoted 5 lines

are not referenced by any code. Remove them.

They can be reintroduced if a real user comes up.

Other than the above too trivial thing,

This patch is applied to damon/next [1] tree with the fix of the trivial commit message length issue. If this patch is not added to mm.git in short term (~1 week?) with the fix, I will ask mm.git maintainer (Andrew Morton) to pick this. So, no action from your side is needed for now. If it seems I also forgot doing that or you cannot wait for my action, please feel free to ping me or Andrew.

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

Thanks,
SJ

[...]

author
#3 lore raw
Quoted 7 lines · SJ Park
Quoted 3 lines · On Sun, 20 Sep 2026 09:20:28 +0800 Zenghui Yu <[email protected]> wrote:

From: "Zenghui Yu (Huawei)" <[email protected]>

NR_DAMOS_ACTIONS, NR_DAMOS_QUOTA_GOAL_METRICS, and NR_DAMOS_WMARK_METRICS

More than 72 columns.

I learnt from submitting-patches.rst that

- The body of the explanation, line wrapped at 75 columns, which will be copied to the permanent changelog to describe this patch.

But I'm also fine with the 72 columns rule for damon patches (or for mm patches?).

Quoted 9 lines
Quoted 5 lines

are not referenced by any code. Remove them.

They can be reintroduced if a real user comes up.

Other than the above too trivial thing,

Thanks!

Zenghui

maintainer
#4 lore raw
Quoted 9 lines · On Sun, 20 Sep 2026 20:34:48 +0800 Zenghui Yu <[email protected]> wrote:
Quoted 7 lines · SJ Park
Quoted 3 lines · On Sun, 20 Sep 2026 09:20:28 +0800 Zenghui Yu <[email protected]> wrote:

From: "Zenghui Yu (Huawei)" <[email protected]>

NR_DAMOS_ACTIONS, NR_DAMOS_QUOTA_GOAL_METRICS, and NR_DAMOS_WMARK_METRICS

More than 72 columns.

Quoted 7 lines

I learnt from submitting-patches.rst that

- The body of the explanation, line wrapped at 75 columns, which will be copied to the permanent changelog to describe this patch.

But I'm also fine with the 72 columns rule for damon patches (or for mm patches?).

Ah, thank you for pointing that. Let's use 75 columns.

Thanks,
SJ

[...]