[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1691401475-3796-1-git-send-email-hyeongtak.ji@gmail.com>
Date: Mon, 7 Aug 2023 18:44:35 +0900
From: Hyeongtak Ji <hyeongtak.ji@...il.com>
To: sj@...nel.org, akpm@...ux-foundation.org
Cc: damon@...ts.linux.dev, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Hyeongtak Ji <hyeongtak.ji@...il.com>,
Hyeongtak Ji <hyeongtak.ji@...com>
Subject: [PATCH] mm/damon: Prevent unnecessary age reset for regions
DAMON resets the age of each region after applying each scheme,
regardless of whether the scheme has been successfully applied.
This patch adds a simple condition to prevent the age of regions from
being reset when schemes have not been actually applied.
Signed-off-by: Hyeongtak Ji <hyeongtak.ji@...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 91cff7f2997e..4044fcf18ac1 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -908,7 +908,7 @@ static void damos_apply_scheme(struct damon_ctx *c, struct damon_target *t,
quota->charge_addr_from = r->ar.end + 1;
}
}
- if (s->action != DAMOS_STAT)
+ if (s->action != DAMOS_STAT && sz_applied > 0)
r->age = 0;
update_stat:
--
2.7.4
Powered by blists - more mailing lists