[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221127182254.4850-1-sj@kernel.org>
Date: Sun, 27 Nov 2022 18:22:54 +0000
From: SeongJae Park <sj@...nel.org>
To: SeongJae Park <sj@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>, damon@...ts.linux.dev,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 07/11] mm/damon/sysfs-schemes: connect filter directory and filters directory
On Thu, 24 Nov 2022 21:21:10 +0000 SeongJae Park <sj@...nel.org> wrote:
> Implement 'nr_filters' file under 'filters' directory, which will be
> used to populate specific number of 'filter' directory under the
> directory, similar to other 'nr_*' files in DAMON sysfs interface.
>
> Signed-off-by: SeongJae Park <sj@...nel.org>
> ---
> mm/damon/sysfs-schemes.c | 67 ++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 67 insertions(+)
>
> diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c
> index afbfc55a8e84..7f2bab617156 100644
> --- a/mm/damon/sysfs-schemes.c
> +++ b/mm/damon/sysfs-schemes.c
[...]
> @@ -401,6 +407,57 @@ damon_sysfs_scheme_filters_alloc(void)
> return kzalloc(sizeof(struct damon_sysfs_scheme_filters), GFP_KERNEL);
> }
>
> +static void damon_sysfs_scheme_filters_rm_dirs(
> + struct damon_sysfs_scheme_filters *filters)
> +{
> + struct damon_sysfs_scheme_filter **filters_arr = filters->filters_arr;
> + int i;
> +
> + for (i = 0; i < filters->nr; i++)
> + kobject_put(&filters_arr[i]->kobj);
> + filters->nr = 0;
> + kfree(filters_arr);
> + filters->filters_arr = NULL;
> +}
This function should also be called from damon_Sysfs_scheme_rm_dirs() but this
patch is missing that. This could result in undeleted filters directory when
writing 0 to 'nr_schemes' file. Next version of this patchset will fix that.
Thanks,
SJ
[...]
Powered by blists - more mailing lists