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: <20250813170806.6251-1-sj@kernel.org>
Date: Wed, 13 Aug 2025 10:08:06 -0700
From: SeongJae Park <sj@...nel.org>
To: Quanmin Yan <yanquanmin1@...wei.com>
Cc: SeongJae Park <sj@...nel.org>,
	akpm@...ux-foundation.org,
	damon@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	linux-mm@...ck.org,
	wangkefeng.wang@...wei.com,
	zuoze1@...wei.com
Subject: Re: [RFC PATCH -next 14/16] mm/damon/core: convert sz to byte units when updating state

On Wed, 13 Aug 2025 13:07:04 +0800 Quanmin Yan <yanquanmin1@...wei.com> wrote:

> After introducing ctx->addr_unit, the unit of sz might not
> be in bytes. However, sz_applied is returned in bytes after
> processing by paddr.

This is not an intended behavior, but a bug of my code.  Let's update patches
3-6 of this series to return sz_applied as core-layer address unit, instead of
bytes.

> To maintain external consistency, sz
> is converted to byte units when updating the state.

Users could keep the consistency by multiplying the addr_unit, which they set
themselves.

> 
> Signed-off-by: Quanmin Yan <yanquanmin1@...wei.com>
> ---
>  mm/damon/core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/mm/damon/core.c b/mm/damon/core.c
> index b162aa1156fc..bc764f9dc5c5 100644
> --- a/mm/damon/core.c
> +++ b/mm/damon/core.c
> @@ -1889,7 +1889,9 @@ static void damos_apply_scheme(struct damon_ctx *c, struct damon_target *t,
>  		r->age = 0;
>  
>  update_stat:
> -	damos_update_stat(s, sz, sz_applied, sz_ops_filter_passed);
> +	damos_update_stat(s,
> +			sz * (c->ops.id == DAMON_OPS_PADDR ? c->addr_unit : 1),
> +			sz_applied, sz_ops_filter_passed);
>  }
>  
>  static void damon_do_apply_schemes(struct damon_ctx *c,
> -- 
> 2.34.1


Thanks,
SJ

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ