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 v2 00/10] mm/damon: extend DAMOS filters for inclusion of target memory
Date: Fri, 27 Dec 2024 13:08:09 -0800 [thread overview]
Message-ID: <20241227210819.63776-1-sj@kernel.org> (raw)
DAMOS fitlers are exclusive filters. It only excludes memory of
specific types from the DAMOS action targets. This has below problems.
First, the name is not explicitly explaining the behavior. This
actually resulted in confusions[1] and works to improve the siaution[2],
including wordsmithing documentations and adding features to DAMON
user-space tool, damo.
Secondly, the functionality is restrictive. This is especially
problematic when multiple filters need to be used. For example,
building a DAMOS scheme that applies the action to memory that belongs
to cgroup A "or" cgroup B is impossible. A workaroudn is using two
schemes, each filtering out memory that not belong to cgroup A and
cgroup B, respectively. It is cumbersome, and makes control of
quota-like additional factors difficult.
Extend DAMOS filters to support not only excluding (blocking), but also
including (pass-through) behavior. For the extension, add a new
damos_filter struct field called 'pass' for DAMON kernel API users.
Using the API, add a DAMON sysfs file of same name under DAMOS filter
sysfs directory, for DAMON user-space ABI users. To prevent breaking
old users with a behavioral change, set the blocking as the default
behavior.
Note that DAMOS' default behavior without DAMOS filters is applying the
action to any memory. And DAMOS filters work for only memory that
satisfies 'type' and 'matching'. Hence installing pass filter without
any block filter after them makes no filter-behavioral change.
[1] https://lore.kernel.org/20240320165619.71478-1-sj@kernel.org
[2] https://git.kernel.org/sj/damo/c/b6a722c85ff91e5abe9dd47135e300df243da056
Changes from RFC v1
(https://lore.kernel.org/20241226221445.78433-1-sj@kernel.org)
- Fix encoding issue on the last patch
SeongJae Park (10):
mm/damon: fixup damos_filter kernel-doc
mm/damon/core: add damos_filter->pass field
mm/damon/core: support damos_filter->pass
mm/damon/paddr: support damos_filter->pass
mm/damon: add pass argument to damos_new_filter()
mm/damon/sysfs-schemes: add a file for setting damos_filter->pass
Docs/mm/damon/design: document pass/block filters behaviors
Docs/ABI/damon: document DAMOS filter pass sysfs file
Docs/admin-guide/mm/damon/usage: omit DAMOS filter details in favor of
design doc
Docs/admin-guide/mm/damon/usage: document DAMOS filter 'pass' sysfs
file
.../ABI/testing/sysfs-kernel-mm-damon | 14 +++--
Documentation/admin-guide/mm/damon/usage.rst | 55 ++++++++++---------
Documentation/mm/damon/design.rst | 29 ++++++++--
include/linux/damon.h | 15 +++--
mm/damon/core.c | 12 ++--
mm/damon/paddr.c | 9 +--
mm/damon/reclaim.c | 2 +-
mm/damon/sysfs-schemes.c | 32 ++++++++++-
mm/damon/tests/core-kunit.h | 14 ++---
9 files changed, 125 insertions(+), 57 deletions(-)
--
2.39.5
next 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 SeongJae Park [this message]
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 ` [RFC PATCH v2 04/10] mm/damon/paddr: " SeongJae Park
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-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