diff options
| author | SJ Park <sj@kernel.org> | 2026-09-01 06:18:43 -0700 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-09-10 20:20:39 -0700 |
| commit | bb482ca28d2cb2619c2ed648ebd609f8a63e9380 (patch) | |
| tree | dbc0fa8e54e816a54f7648d9f068fcb404e87435 | |
| parent | 4e1db1fc55990ac3aa6ef7cfb95e929e7ed29217 (diff) | |
| download | linux-next-bb482ca28d2cb2619c2ed648ebd609f8a63e9380.tar.gz linux-next-bb482ca28d2cb2619c2ed648ebd609f8a63e9380.zip | |
mm/damon/paddr: respect folio end for DAMOS_STAT
The function for applying DAMOS_STAT in DAMON physical address space
operation set (paddr), namely damon_pa_stat(), applies DAMOS filters to
folios of the given region. For that, it gets folios of addresses in the
region. It starts from the region start address and advances the address
by the size of the folio of the address until it goes out of the region.
If the start address is in the middle of a large folio, and if the next
folios are small, some of the next folios could be skipped. Fix the issue
by advancing the address to exactly the start address of the next folio.
The user impact is that the DAMOS_STAT-based page level monitoring results
become inaccurate. Since the page level monitoring is supposed to provide
relatively high precision, this is definitely a problem. It is arguably
not critical since it is only monitoring quality degradation.
Link: https://lore.kernel.org/20260901131850.98037-3-sj@kernel.org
Fixes: bdbe1d7bc325 ("mm/damon/paddr: increment pa_stat damon address range by folio size")
Signed-off-by: SJ Park <sj@kernel.org>
Cc: Usama Arif <usamaarif642@gmail.com>
Cc: <stable@vger.kernel.org> # 6.14.x
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| -rw-r--r-- | mm/damon/paddr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index 5c6c3a597fd0..2ab7b3842701 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -379,7 +379,7 @@ static unsigned long damon_pa_stat(struct damon_region *r, if (!damos_pa_filter_out(s, folio)) *sz_filter_passed += folio_size(folio) / addr_unit; - addr += folio_size(folio); + addr = PFN_PHYS(folio_pfn(folio)) + folio_size(folio); folio_put(folio); } s->last_applied = folio; |
