From: SeongJae Park <sj@kernel.org>
Cc: SeongJae Park <sj@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Jonathan Corbet <corbet@lwn.net>,
damon@lists.linux.dev, kernel-team@meta.com,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: [RFC PATCH 0/9] mm/damon: make allow filters after reject filters useful and intuitive
Date: Thu, 20 Feb 2025 11:35:00 -0800 [thread overview]
Message-ID: <20250220193509.36379-1-sj@kernel.org> (raw)
DAMOS filters do allow or reject elements of memory for given DAMOS
action only if those match the filter criterias. For elements that
don't match any DAMOS filter, 'allowing' is the default behavior. This
makes 'allow DAMOS filters' that don't have any 'reject DAMOS filter'
after them meaningless sources of overhead. The decision was made to
keep the behavior consistent with before-allow filter behavior. This,
however, only makes usage of DAMOS filters confusing and inefficient.
There is an apparently more intuitive behavior for the case. If there
is no filter at all or the last filter is a reject filter, allowing by
default.
Update the filtering logic to work in the way. Decide the default
behavior as the opposite of the last isntalled filter. If it is an
allow filter, reject by default. If it is a reject filter or no filter
is installed at all, allow by default.
Note that this is changing the old behavior. But the old behavior for
the problematic filter installation was definitely confusing,
inefficient and anyway useless. Also, the behavior has relatively
recently introduced. It is difficult to anticipate any user that
depends on the behavior. Hence this is not a user-breaking behavior
change but an obvious improvement.
SeongJae Park (9):
mm/damon/core: introduce damos->ops_filters
mm/damon/paddr: support ops_filters
mm/damon/core: support committing ops_filters
mm/damon/core: put ops-handled filters to damos->ops_filters
mm/damon/paddr: support only ops_filters
mm/damon: add default allow/reject behavior fields to struct damos
mm/damon/core: set damos_filter default allowance behavior based on
installed filters
mm/damon/paddr: respect ops_filters_default_reject
Docs/mm/damon/design: update for changed filter-default behavior
Documentation/mm/damon/design.rst | 10 ++--
include/linux/damon.h | 11 ++++
mm/damon/core.c | 87 +++++++++++++++++++++++++++++--
mm/damon/paddr.c | 8 +--
4 files changed, 102 insertions(+), 14 deletions(-)
base-commit: 3fb99e5d512f03963c91926628fcc08a96ee07f0
--
2.39.5
next reply other threads:[~2025-02-20 19:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-20 19:35 SeongJae Park [this message]
2025-02-20 19:35 ` [RFC PATCH 1/9] mm/damon/core: introduce damos->ops_filters SeongJae Park
2025-02-20 19:35 ` [RFC PATCH 2/9] mm/damon/paddr: support ops_filters SeongJae Park
2025-02-20 19:35 ` [RFC PATCH 3/9] mm/damon/core: support committing ops_filters SeongJae Park
2025-02-20 19:35 ` [RFC PATCH 4/9] mm/damon/core: put ops-handled filters to damos->ops_filters SeongJae Park
2025-02-20 19:35 ` [RFC PATCH 5/9] mm/damon/paddr: support only ops_filters SeongJae Park
2025-02-20 19:35 ` [RFC PATCH 6/9] mm/damon: add default allow/reject behavior fields to struct damos SeongJae Park
2025-02-20 19:35 ` [RFC PATCH 7/9] mm/damon/core: set damos_filter default allowance behavior based on installed filters SeongJae Park
2025-02-27 0:29 ` SeongJae Park
2025-02-20 19:35 ` [RFC PATCH 8/9] mm/damon/paddr: respect ops_filters_default_reject SeongJae Park
2025-02-20 19:35 ` [RFC PATCH 9/9] Docs/mm/damon/design: update for changed filter-default behavior 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=20250220193509.36379-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=damon@lists.linux.dev \
--cc=kernel-team@meta.com \
--cc=linux-doc@vger.kernel.org \
--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