Commit 8ef4d5ca authored by Kaixu Xia's avatar Kaixu Xia Committed by Andrew Morton

mm/damon: simplify the parameter passing for 'prepare_access_checks'

Patch series "mm/damon: code simplifications and cleanups".

This patchset contains some code simplifications and cleanups for DAMON.


This patch (of 4):

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.

Link: https://lkml.kernel.org/r/1663060287-30201-1-git-send-email-kaixuxia@tencent.com
Link: https://lkml.kernel.org/r/1663060287-30201-2-git-send-email-kaixuxia@tencent.comSigned-off-by: default avatarKaixu Xia <kaixuxia@tencent.com>
Reviewed-by: default avatarSeongJae Park <sj@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent a62518ab
...@@ -63,8 +63,7 @@ static void damon_pa_mkold(unsigned long paddr) ...@@ -63,8 +63,7 @@ static void damon_pa_mkold(unsigned long paddr)
folio_put(folio); folio_put(folio);
} }
static void __damon_pa_prepare_access_check(struct damon_ctx *ctx, static void __damon_pa_prepare_access_check(struct damon_region *r)
struct damon_region *r)
{ {
r->sampling_addr = damon_rand(r->ar.start, r->ar.end); 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) ...@@ -78,7 +77,7 @@ static void damon_pa_prepare_access_checks(struct damon_ctx *ctx)
damon_for_each_target(t, ctx) { damon_for_each_target(t, ctx) {
damon_for_each_region(r, t) damon_for_each_region(r, t)
__damon_pa_prepare_access_check(ctx, r); __damon_pa_prepare_access_check(r);
} }
} }
......
...@@ -397,8 +397,8 @@ static void damon_va_mkold(struct mm_struct *mm, unsigned long addr) ...@@ -397,8 +397,8 @@ static void damon_va_mkold(struct mm_struct *mm, unsigned long addr)
* Functions for the access checking of the regions * Functions for the access checking of the regions
*/ */
static void __damon_va_prepare_access_check(struct damon_ctx *ctx, static void __damon_va_prepare_access_check(struct mm_struct *mm,
struct mm_struct *mm, struct damon_region *r) struct damon_region *r)
{ {
r->sampling_addr = damon_rand(r->ar.start, r->ar.end); 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) ...@@ -416,7 +416,7 @@ static void damon_va_prepare_access_checks(struct damon_ctx *ctx)
if (!mm) if (!mm)
continue; continue;
damon_for_each_region(r, t) damon_for_each_region(r, t)
__damon_va_prepare_access_check(ctx, mm, r); __damon_va_prepare_access_check(mm, r);
mmput(mm); mmput(mm);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment