lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220827212401.50416-1-sj@kernel.org>
Date:   Sat, 27 Aug 2022 21:24:01 +0000
From:   SeongJae Park <sj@...nel.org>
To:     xiakaixu1987@...il.com
Cc:     sj@...nel.org, akpm@...ux-foundation.org, damon@...ts.linux.dev,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Kaixu Xia <kaixuxia@...cent.com>
Subject: Re: [PATCH v2 1/2] mm/damon: simplify the parameter passing for 'check_accesses'

Hi Kaixu,

On Sat, 27 Aug 2022 17:02:50 +0800 xiakaixu1987@...il.com wrote:

> From: Kaixu Xia <kaixuxia@...cent.com>
> 
> The parameter 'struct damon_ctx *ctx' isn't used in the functions
> __damon_{p,v}a_check_access(), so we can remove it and simplify the
> parameter passing.
> 
> Signed-off-by: Kaixu Xia <kaixuxia@...cent.com>

Reviewed-by: SeongJae Park <sj@...nel.org>


Thanks,
SJ

> ---
>  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 dc131c6a5403..6b0d9e6aa677 100644
> --- a/mm/damon/paddr.c
> +++ b/mm/damon/paddr.c
> @@ -166,8 +166,7 @@ static bool damon_pa_young(unsigned long paddr, unsigned long *page_sz)
>  	return result.accessed;
>  }
>  
> -static void __damon_pa_check_access(struct damon_ctx *ctx,
> -				    struct damon_region *r)
> +static void __damon_pa_check_access(struct damon_region *r)
>  {
>  	static unsigned long last_addr;
>  	static unsigned long last_page_sz = PAGE_SIZE;
> @@ -196,7 +195,7 @@ static unsigned int damon_pa_check_accesses(struct damon_ctx *ctx)
>  
>  	damon_for_each_target(t, ctx) {
>  		damon_for_each_region(r, t) {
> -			__damon_pa_check_access(ctx, r);
> +			__damon_pa_check_access(r);
>  			max_nr_accesses = max(r->nr_accesses, max_nr_accesses);
>  		}
>  	}
> diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
> index 3c7b9d6dca95..e481f81c3efb 100644
> --- a/mm/damon/vaddr.c
> +++ b/mm/damon/vaddr.c
> @@ -532,8 +532,8 @@ static bool damon_va_young(struct mm_struct *mm, unsigned long addr,
>   * mm	'mm_struct' for the given virtual address space
>   * r	the region to be checked
>   */
> -static void __damon_va_check_access(struct damon_ctx *ctx,
> -			       struct mm_struct *mm, struct damon_region *r)
> +static void __damon_va_check_access(struct mm_struct *mm,
> +				struct damon_region *r)
>  {
>  	static struct mm_struct *last_mm;
>  	static unsigned long last_addr;
> @@ -568,7 +568,7 @@ static unsigned int damon_va_check_accesses(struct damon_ctx *ctx)
>  		if (!mm)
>  			continue;
>  		damon_for_each_region(r, t) {
> -			__damon_va_check_access(ctx, mm, r);
> +			__damon_va_check_access(mm, r);
>  			max_nr_accesses = max(r->nr_accesses, max_nr_accesses);
>  		}
>  		mmput(mm);
> -- 
> 2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ