public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/damon/core: make charge_addr_from aware of end-address exclusivity
@ 2026-04-28  4:29 SeongJae Park
  0 siblings, 0 replies; only message in thread
From: SeongJae Park @ 2026-04-28  4:29 UTC (permalink / raw)
  To: Andrew Morton; +Cc: SeongJae Park, # 5 . 16 . x, damon, linux-kernel, linux-mm

DAMON region end address is exclusive one, but charge_addr_from is
assigned assuming the end address is inclusive.  As a result, DAMOS
action to next up to min_region_sz memory can be skipped.  This is quite
negligible user impact.  But, the bug is a bug that can be very simply
fixed.  Fix the wrong assignment to respect the exclusiveness of the
address.

The issue was discovered [1] by Sashiko.

[1] https://lore.kernel.org/20260428032324.115663-1-sj@kernel.org

Fixes: 50585192bc2e ("mm/damon/schemes: skip already charged targets and regions")
Cc: <stable@vger.kernel.org> # 5.16.x
Signed-off-by: SeongJae Park <sj@kernel.org>
---
 mm/damon/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/damon/core.c b/mm/damon/core.c
index 278594847cf94..37c9a40d0577b 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -2107,7 +2107,7 @@ static void damos_apply_scheme(struct damon_ctx *c, struct damon_target *t,
 		if (damos_quota_is_set(quota) &&
 				quota->charged_sz >= quota->esz) {
 			quota->charge_target_from = t;
-			quota->charge_addr_from = r->ar.end + 1;
+			quota->charge_addr_from = r->ar.end;
 		}
 	}
 	if (s->action != DAMOS_STAT)

base-commit: 986c714ac6faa9750e15ccaec72ff2823c96a5c6
-- 
2.47.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-28  4:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-28  4:29 [PATCH] mm/damon/core: make charge_addr_from aware of end-address exclusivity SeongJae Park

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