All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/damon/core: accumulate applied size to quota->charged_sz
@ 2024-11-29  8:31 Honggyu Kim
  2024-11-29 19:55 ` SeongJae Park
  0 siblings, 1 reply; 4+ messages in thread
From: Honggyu Kim @ 2024-11-29  8:31 UTC (permalink / raw)
  To: damon; +Cc: SeongJae Park, kernel_team, Honggyu Kim, Yunjeong Mun

While testing DAMOS_MIGRATE_COLD action, Yunjeong found that the
quota->charged_sz is way less than actually migrated size.

In damos_apply_scheme(), quota->charged_sz is used when checking whether
the quota exceeds the effective size.  The current implementation
accumulates the charged_sz with sz(region size), but many pages in the
region might be discarded by DAMOS filters.

In order to make the quota calculation more accurate, charged_sz is
better to be accumulated by the actually applied size, which is
sz_applied in the code.

Reported-by: Yunjeong Mun <yunjeong.mun@sk.com>
Signed-off-by: Honggyu Kim <honggyu.kim@sk.com>
---
 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 511c3f61ab44..dd1b56466650 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -1390,7 +1390,7 @@ static void damos_apply_scheme(struct damon_ctx *c, struct damon_target *t,
 		ktime_get_coarse_ts64(&end);
 		quota->total_charged_ns += timespec64_to_ns(&end) -
 			timespec64_to_ns(&begin);
-		quota->charged_sz += sz;
+		quota->charged_sz += sz_applied;
 		if (quota->esz && quota->charged_sz >= quota->esz) {
 			quota->charge_target_from = t;
 			quota->charge_addr_from = r->ar.end + 1;

base-commit: adc218676eef25575469234709c2d87185ca223a
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-12-02 17:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-29  8:31 [PATCH] mm/damon/core: accumulate applied size to quota->charged_sz Honggyu Kim
2024-11-29 19:55 ` SeongJae Park
2024-12-02 12:24   ` Honggyu Kim
2024-12-02 17:21     ` SeongJae Park

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.