[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220913151114.103184-1-sj@kernel.org>
Date: Tue, 13 Sep 2022 15:11:14 +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 4/4] mm/damon/vaddr: indicate the target is invalid when 'nr_regions' is zero
On Tue, 13 Sep 2022 17:11:27 +0800 xiakaixu1987@...il.com wrote:
> From: Kaixu Xia <kaixuxia@...cent.com>
>
> When 'init()' and 'update()' DAMON operations failed and the number
> of the damon_target regions is zero,
Well, I think that could be a temporal failure. In the case, later call of
'update()' could success?
Thanks,
SJ
> the kdamond would do nothing
> to this monitoring target in this case. It makes no sense to run
> kdamond when all of monitoring targets have no regions. So add the
> judgement in 'target_valid()' operation to indicate the target is
> invalid when 'nr_regions' is zero.
>
> Signed-off-by: Kaixu Xia <kaixuxia@...cent.com>
> ---
> mm/damon/vaddr.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
> index 39ea48d9cc15..65ff98d49ec0 100644
> --- a/mm/damon/vaddr.c
> +++ b/mm/damon/vaddr.c
> @@ -598,6 +598,9 @@ static bool damon_va_target_valid(void *target)
> struct damon_target *t = target;
> struct task_struct *task;
>
> + if (!damon_nr_regions(t))
> + return false;
> +
> task = damon_get_task_struct(t);
> if (task) {
> put_task_struct(task);
> --
> 2.27.0
Powered by blists - more mailing lists