]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm/damon/core: make charge_addr_from aware of end-address exclusivity
authorSeongJae Park <sj@kernel.org>
Tue, 28 Apr 2026 04:29:40 +0000 (21:29 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 29 May 2026 04:04:41 +0000 (21:04 -0700)
commit5a2d162e22bf33eb89d53e802d0fc1ec422e19b6
tree853d4752b0c267ba13bf855376a1eaf82ac332e1
parent214f9ab72ce6e16120c20ad670389656f059e685
mm/damon/core: make charge_addr_from aware of end-address exclusivity

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.

Link: https://lore.kernel.org/20260428042942.118230-1-sj@kernel.org
Link: https://lore.kernel.org/20260428032324.115663-1-sj@kernel.org
Fixes: 50585192bc2e ("mm/damon/schemes: skip already charged targets and regions")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org> # 5.16.x
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/core.c