[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221127195121.1388-1-sj@kernel.org>
Date: Sun, 27 Nov 2022 19:51:21 +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 08/11] mm/damon/sysfs-schemes: implement scheme filters
On Thu, 24 Nov 2022 21:21:11 +0000 SeongJae Park <sj@...nel.org> wrote:
> Implement scheme filters functionality of DAMON sysfs interface by
> making the code reads the values of files under the filter directories
> and pass that to DAMON using DAMON kernel API.
>
> Signed-off-by: SeongJae Park <sj@...nel.org>
> ---
> mm/damon/sysfs-schemes.c | 85 +++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 84 insertions(+), 1 deletion(-)
>
> diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c
> index 7f2bab617156..6f014b328e6f 100644
> --- a/mm/damon/sysfs-schemes.c
> +++ b/mm/damon/sysfs-schemes.c
[...]
> +static int damon_sysfs_set_scheme_filters(struct damos *scheme,
> + struct damon_sysfs_scheme_filters *sysfs_filters)
> +{
> + int i;
> + struct damos_filter *filter, *next;
> +
> + damos_for_each_filter_safe(filter, next, scheme)
> + damos_destroy_filter(filter);
> +
> + for (i = 0; i < sysfs_filters->nr; i++) {
> + struct damon_sysfs_scheme_filter *sysfs_filter =
> + sysfs_filters->filters_arr[i];
> + struct damos_filter *filter =
> + damos_new_filter(sysfs_filter->type,
> + sysfs_filter->matching);
> + int err;
> +
> + if (!filter)
> + return -ENOMEM;
> + if (filter->type == DAMOS_FILTER_TYPE_MEMCG) {
> + err = damon_sysfs_memcg_path_to_id(
> + sysfs_filter->memcg_path,
> + &filter->memcg_id);
> + if (err)
> + return err;
> + }
Newly created filter should be added to the scheme, but this patch is missing
the code. Will add that in the next version of this patch.
> + }
> + return 0;
> +}
> +
Powered by blists - more mailing lists