[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20230116173159.23307-1-sj@kernel.org>
Date: Mon, 16 Jan 2023 17:31:59 +0000
From: SeongJae Park <sj@...nel.org>
To: Huaisheng Ye <huaisheng.ye@...el.com>
Cc: sj@...nel.org, akpm@...ux-foundation.org, damon@...ts.linux.dev,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/damon/core: skip apply schemes if empty
Hi Huaisheng,
On Mon, 16 Jan 2023 14:23:47 +0800 Huaisheng Ye <huaisheng.ye@...el.com> wrote:
> Sometimes there is no scheme in damon's context, for example
> just use damo record to monitor workload's data access pattern.
>
> If current damon context doesn't have any scheme in the list,
> kdamond has no need to iterate over list of all targets and regions
> but do nothing.
>
> So, skip apply schemes when ctx->schemes is empty.
Good finding, thanks!
>
> Signed-off-by: Huaisheng Ye <huaisheng.ye@...el.com>
Reviewed-by: SeongJae Park <sj@...nel.org>
Thanks,
SJ
> ---
> mm/damon/core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/mm/damon/core.c b/mm/damon/core.c
> index ceec75b88ef9..f338691e4591 100644
> --- a/mm/damon/core.c
> +++ b/mm/damon/core.c
> @@ -1230,7 +1230,8 @@ static int kdamond_fn(void *data)
> if (ctx->callback.after_aggregation &&
> ctx->callback.after_aggregation(ctx))
> break;
> - kdamond_apply_schemes(ctx);
> + if (!list_empty(&ctx->schemes))
> + kdamond_apply_schemes(ctx);
> kdamond_reset_aggregated(ctx);
> kdamond_split_regions(ctx);
> if (ctx->ops.reset_aggregated)
> --
> 2.31.1
>
>
Powered by blists - more mailing lists