[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250819155604.43810-1-sj@kernel.org>
Date: Tue, 19 Aug 2025 08:56:04 -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 07/16] mm/damon/sysfs: implement addr_unit file under context dir
On Tue, 19 Aug 2025 22:45:58 +0800 Quanmin Yan <yanquanmin1@...wei.com> wrote:
> Hi SJ,
>
> 在 2025/8/19 14:24, SeongJae Park 写道:
> > Hi Quanmin,
> >
> > As I suggested on another reply[1], please squash attaching patch to this one
> > when you post next version of this series.
> >
> > [1] https://lore.kernel.org/20250813170224.6128-1-sj@kernel.org
> >
> > [...]
> >
> >
> > Thanks,
> > SJ
> >
> > ==== Attachment 0 (0001-mm-damon-sysfs-return-EINVAL-for-zero-addr_unit.patch) ====
> > From e0a5aa5e571ecd0f58b0914f8fc8562a60014ae8 Mon Sep 17 00:00:00 2001
> > From: SeongJae Park <sj@...nel.org>
> > Date: Wed, 13 Aug 2025 21:17:03 -0700
> > Subject: [PATCH] mm/damon/sysfs: return -EINVAL for zero addr_unit
> >
> > Signed-off-by: SeongJae Park <sj@...nel.org>
> > ---
> > mm/damon/sysfs.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
> > index bea782b0a711..eb4269383bae 100644
> > --- a/mm/damon/sysfs.c
> > +++ b/mm/damon/sysfs.c
> > @@ -1422,6 +1422,8 @@ static int damon_sysfs_apply_inputs(struct damon_ctx *ctx,
> > err = damon_select_ops(ctx, sys_ctx->ops_id);
> > if (err)
> > return err;
> > + if (!sys_ctx->addr_unit)
> > + return -EINVAL;
> > ctx->addr_unit = sys_ctx->addr_unit;
> > err = damon_sysfs_set_attrs(ctx, sys_ctx->attrs);
> > if (err)
>
> Aha, returning -EINVAL when sys_ctx->addr_unit is 0 makes sense, but I wonder if it
> might be better to prevent users from inputting 0 at the source instead? I've attempted
> to modify patch 7 by adding a check in addr_unit_store.
I agree that is better. Please don't forget adding your Signed-off-by: to the
patch.
> I'll send out the v2 version
> of patch 7 later (PS: I am performing a comprehensive validation of the v2 patch series),
> and we can discuss it then.
Looking forwrd to the patch! :)
Thanks,
SJ
[...]
Powered by blists - more mailing lists