From: xiakaixu1987@gmail.com
To: sj@kernel.org, akpm@linux-foundation.org
Cc: damon@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Kaixu Xia <kaixuxia@tencent.com>
Subject: [PATCH 1/4] mm/damon: simplify the parameter passing for 'prepare_access_checks'
Date: Tue, 13 Sep 2022 17:11:24 +0800 [thread overview]
Message-ID: <1663060287-30201-2-git-send-email-kaixuxia@tencent.com> (raw)
In-Reply-To: <1663060287-30201-1-git-send-email-kaixuxia@tencent.com>
From: Kaixu Xia <kaixuxia@tencent.com>
The parameter 'struct damon_ctx *ctx' isn't used in the functions
__damon_{p,v}a_prepare_access_check(), so we can remove it and
simplify the parameter passing.
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
mm/damon/paddr.c | 5 ++---
mm/damon/vaddr.c | 6 +++---
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
index 6b0d9e6aa677..f00cbe74a00e 100644
--- a/mm/damon/paddr.c
+++ b/mm/damon/paddr.c
@@ -63,8 +63,7 @@ static void damon_pa_mkold(unsigned long paddr)
folio_put(folio);
}
-static void __damon_pa_prepare_access_check(struct damon_ctx *ctx,
- struct damon_region *r)
+static void __damon_pa_prepare_access_check(struct damon_region *r)
{
r->sampling_addr = damon_rand(r->ar.start, r->ar.end);
@@ -78,7 +77,7 @@ static void damon_pa_prepare_access_checks(struct damon_ctx *ctx)
damon_for_each_target(t, ctx) {
damon_for_each_region(r, t)
- __damon_pa_prepare_access_check(ctx, r);
+ __damon_pa_prepare_access_check(r);
}
}
diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
index c2c08c1b316b..39ea48d9cc15 100644
--- a/mm/damon/vaddr.c
+++ b/mm/damon/vaddr.c
@@ -397,8 +397,8 @@ static void damon_va_mkold(struct mm_struct *mm, unsigned long addr)
* Functions for the access checking of the regions
*/
-static void __damon_va_prepare_access_check(struct damon_ctx *ctx,
- struct mm_struct *mm, struct damon_region *r)
+static void __damon_va_prepare_access_check(struct mm_struct *mm,
+ struct damon_region *r)
{
r->sampling_addr = damon_rand(r->ar.start, r->ar.end);
@@ -416,7 +416,7 @@ static void damon_va_prepare_access_checks(struct damon_ctx *ctx)
if (!mm)
continue;
damon_for_each_region(r, t)
- __damon_va_prepare_access_check(ctx, mm, r);
+ __damon_va_prepare_access_check(mm, r);
mmput(mm);
}
}
--
2.27.0
next prev parent reply other threads:[~2022-09-13 9:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-13 9:11 [PATCH 0/4] mm/damon: code simplifications and cleanups xiakaixu1987
2022-09-13 9:11 ` xiakaixu1987 [this message]
2022-09-13 9:11 ` [PATCH 2/4] mm/damon/sysfs: simplify the variable 'pid' assignment operation xiakaixu1987
2022-09-13 9:11 ` [PATCH 3/4] mm/damon/core: simplify the kdamond stop mechanism by removing 'done' xiakaixu1987
2022-09-13 9:11 ` [PATCH 4/4] mm/damon/vaddr: indicate the target is invalid when 'nr_regions' is zero xiakaixu1987
2022-09-13 15:11 ` SeongJae Park
2022-09-14 4:02 ` Kaixu Xia
2022-09-14 8:04 ` SeongJae Park
2022-09-14 8:21 ` Kaixu Xia
2022-09-13 15:12 ` [PATCH 0/4] mm/damon: code simplifications and cleanups SeongJae Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1663060287-30201-2-git-send-email-kaixuxia@tencent.com \
--to=xiakaixu1987@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=kaixuxia@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).