From: SeongJae Park <sj@kernel.org>
To: SeongJae Park <sj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
damon@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 08/11] mm/damon/sysfs-schemes: implement scheme filters
Date: Sun, 27 Nov 2022 19:51:21 +0000 [thread overview]
Message-ID: <20221127195121.1388-1-sj@kernel.org> (raw)
In-Reply-To: <20221124212114.136863-9-sj@kernel.org>
On Thu, 24 Nov 2022 21:21:11 +0000 SeongJae Park <sj@kernel.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@kernel.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;
> +}
> +
next prev parent reply other threads:[~2022-11-27 19:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-24 21:21 [RFC PATCH 00/11] implement DAMOS filtering for anon pages and SeongJae Park
2022-11-24 21:21 ` [RFC PATCH 01/11] mm/damon/core: implement damos filter SeongJae Park
2022-11-24 21:21 ` [RFC PATCH 02/11] mm/damon/paddr: support DAMOS filters SeongJae Park
2022-11-24 21:21 ` [RFC PATCH 03/11] mm/damon/reclaim: add a parameter called skip_anon for avoiding anonymous pages reclamation SeongJae Park
2022-11-24 21:21 ` [RFC PATCH 04/11] Docs/admin-guide/damon/reclaim: document 'skip_anon' parameter SeongJae Park
2022-11-24 21:21 ` [RFC PATCH 05/11] mm/damon/sysfs-schemes: implement filters directory SeongJae Park
2022-11-24 21:21 ` [RFC PATCH 06/11] mm/damon/sysfs-schemes: implement filter directory SeongJae Park
2022-11-24 21:21 ` [RFC PATCH 07/11] mm/damon/sysfs-schemes: connect filter directory and filters directory SeongJae Park
2022-11-27 18:22 ` SeongJae Park
2022-11-24 21:21 ` [RFC PATCH 08/11] mm/damon/sysfs-schemes: implement scheme filters SeongJae Park
2022-11-27 19:51 ` SeongJae Park [this message]
2022-11-30 19:26 ` SeongJae Park
2022-11-24 21:21 ` [RFC PATCH 09/11] selftests/damon/sysfs: test filters directory SeongJae Park
2022-11-24 21:21 ` [RFC PATCH 10/11] Docs/admin-guide/mm/damon/usage: document DAMOS filters of sysfs SeongJae Park
2022-11-24 21:21 ` [RFC PATCH 11/11] Docs/ABI/damon: document scheme filters files SeongJae Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221127195121.1388-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).