Skip to contentSkip to conversation

mm/damon: remove unused target param of get_scheme_score()

PATCH Applied [email protected] 2 participants 2 messages Feb 13

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mm/damon: remove unused target param of get_scheme_score()

From: Asier Gutierrez <[email protected]>

damon_target is not used by get_scheme_score operations, nor with virtual neither with physical addresses.

Changes in v2:
- Patch against mm-next

---
 include/linux/damon.h |  3 +--
 mm/damon/core.c       | 10 +++++-----
 mm/damon/paddr.c      |  3 +--
 mm/damon/vaddr.c      |  3 +--
 4 files changed, 8 insertions(+), 11 deletions(-)
include/linux/damon.h +1 -2
index a4fea23da857..9a88cf8d152d 100644
@@ -647,8 +647,7 @@ struct damon_operations {
 	void (*prepare_access_checks)(struct damon_ctx *context);
 	unsigned int (*check_accesses)(struct damon_ctx *context);
 	int (*get_scheme_score)(struct damon_ctx *context,
-			struct damon_target *t, struct damon_region *r,
-			struct damos *scheme);
+			struct damon_region *r, struct damos *scheme);
 	unsigned long (*apply_scheme)(struct damon_ctx *context,
 			struct damon_target *t, struct damon_region *r,
 			struct damos *scheme, unsigned long *sz_filter_passed);
mm/damon/core.c +5 -5
index 5e2724a4f285..925908415a04 100644
@@ -1679,15 +1679,15 @@ static bool __damos_valid_target(struct damon_region *r, struct damos *s)
 		r->age <= s->pattern.max_age_region;
 }
 
-static bool damos_valid_target(struct damon_ctx *c, struct damon_target *t,
-		struct damon_region *r, struct damos *s)
+static bool damos_valid_target(struct damon_ctx *c, struct damon_region *r,
+		struct damos *s)
 {
 	bool ret = __damos_valid_target(r, s);
 
 	if (!ret || !s->quota.esz || !c->ops.get_scheme_score)
 		return ret;
 
-	return c->ops.get_scheme_score(c, t, r, s) >= s->quota.min_score;
+	return c->ops.get_scheme_score(c, r, s) >= s->quota.min_score;
 }
 
 /*
@@ -2011,7 +2011,7 @@ static void damon_do_apply_schemes(struct damon_ctx *c,
 				s->max_nr_snapshots <= s->stat.nr_snapshots)
 			continue;
 
-		if (damos_valid_target(c, t, r, s))
+		if (damos_valid_target(c, r, s))
 			damos_apply_scheme(c, t, r, s);
 
 		if (damon_is_last_region(r, t))
@@ -2309,7 +2309,7 @@ static void damos_adjust_quota(struct damon_ctx *c, struct damos *s)
 		damon_for_each_region(r, t) {
 			if (!__damos_valid_target(r, s))
 				continue;
-			score = c->ops.get_scheme_score(c, t, r, s);
+			score = c->ops.get_scheme_score(c, r, s);
 			c->regions_score_histogram[score] +=
 				damon_sz_region(r);
 			if (score > max_score)
mm/damon/paddr.c +1 -2
index 9bfe48826840..5cdcc5037cbc 100644
@@ -343,8 +343,7 @@ static unsigned long damon_pa_apply_scheme(struct damon_ctx *ctx,
 }
 
 static int damon_pa_scheme_score(struct damon_ctx *context,
-		struct damon_target *t, struct damon_region *r,
-		struct damos *scheme)
+		struct damon_region *r, struct damos *scheme)
 {
 	switch (scheme->action) {
 	case DAMOS_PAGEOUT:
mm/damon/vaddr.c +1 -2
index 83ab3d8c3792..4e3430d4191d 100644
@@ -986,8 +986,7 @@ static unsigned long damon_va_apply_scheme(struct damon_ctx *ctx,
 }
 
 static int damon_va_scheme_score(struct damon_ctx *context,
-		struct damon_target *t, struct damon_region *r,
-		struct damos *scheme)
+		struct damon_region *r, struct damos *scheme)
 {
 
 	switch (scheme->action) {
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · On Fri, 13 Feb 2026 14:50:32 +0000 <[email protected]> wrote:

From: Asier Gutierrez <[email protected]>

damon_target is not used by get_scheme_score operations, nor with virtual neither with physical addresses.

Changes in v2:
- Patch against mm-next

You mean mm-new ?

You should put changelogs under below '---' line [1]. Also, pleae consider adding [2] link to the previous version if it is no big deal. I understand the previous version of this patch is at lore.kernel.org [3].

Quoted 2 lines

I believe Andrew would move the above changelog under the below commentary section when he adds this to mm-new. So you don't need to do one more revision.

Thank you for this patch :)

[1] https://docs.kernel.org/process/submitting-patches.html#commentary
[2] https://origin.kernel.org/doc/html/next/process/submitting-patches.html#commentary
[3] https://lore.kernel.org/[email protected]

Thanks,
SJ

[...]