All of lore.kernel.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
Cc: SeongJae Park <sj@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	damon@lists.linux.dev, kernel-team@meta.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: [RFC PATCH v2 04/10] mm/damon/paddr: support damos_filter->pass
Date: Fri, 27 Dec 2024 13:08:13 -0800	[thread overview]
Message-ID: <20241227210819.63776-5-sj@kernel.org> (raw)
In-Reply-To: <20241227210819.63776-1-sj@kernel.org>

'paddr', a DAMON operations set implementation for the physical address
space supports a few types of DAMOS filters (anon, memcg and young), but
ignoring the ->pass field.  Update the logic to support the behavior.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 mm/damon/paddr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
index b0c283808ba6..71cb02128b46 100644
--- a/mm/damon/paddr.c
+++ b/mm/damon/paddr.c
@@ -198,7 +198,7 @@ static unsigned int damon_pa_check_accesses(struct damon_ctx *ctx)
 	return max_nr_accesses;
 }
 
-static bool __damos_pa_filter_out(struct damos_filter *filter,
+static bool damos_pa_filter_match(struct damos_filter *filter,
 		struct folio *folio)
 {
 	bool matched = false;
@@ -237,8 +237,8 @@ static bool damos_pa_filter_out(struct damos *scheme, struct folio *folio)
 	struct damos_filter *filter;
 
 	damos_for_each_filter(filter, scheme) {
-		if (__damos_pa_filter_out(filter, folio))
-			return true;
+		if (damos_pa_filter_match(filter, folio))
+			return !filter->pass;
 	}
 	return false;
 }
-- 
2.39.5

  parent reply	other threads:[~2024-12-27 21:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-27 21:08 [RFC PATCH v2 00/10] mm/damon: extend DAMOS filters for inclusion of target memory SeongJae Park
2024-12-27 21:08 ` [RFC PATCH v2 01/10] mm/damon: fixup damos_filter kernel-doc SeongJae Park
2024-12-27 21:08 ` [RFC PATCH v2 02/10] mm/damon/core: add damos_filter->pass field SeongJae Park
2024-12-27 21:08 ` [RFC PATCH v2 03/10] mm/damon/core: support damos_filter->pass SeongJae Park
2024-12-27 21:08 ` SeongJae Park [this message]
2024-12-27 21:08 ` [RFC PATCH v2 05/10] mm/damon: add pass argument to damos_new_filter() SeongJae Park
2024-12-27 21:08 ` [RFC PATCH v2 06/10] mm/damon/sysfs-schemes: add a file for setting damos_filter->pass SeongJae Park
2024-12-27 21:08 ` [RFC PATCH v2 07/10] Docs/mm/damon/design: document pass/block filters behaviors SeongJae Park
2024-12-27 21:08 ` [RFC PATCH v2 08/10] Docs/ABI/damon: document DAMOS filter pass sysfs file SeongJae Park
2024-12-27 21:08 ` [RFC PATCH v2 09/10] Docs/admin-guide/mm/damon/usage: omit DAMOS filter details in favor of design doc SeongJae Park
2024-12-27 21:08 ` [RFC PATCH v2 10/10] Docs/admin-guide/mm/damon/usage: document DAMOS filter 'pass' sysfs file 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=20241227210819.63776-5-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=kernel-team@meta.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.