From: SJ Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: SJ Park <sj@kernel.org>,
stable@vger.kernel.org, Bijan Tabatabai <bijan311@gmail.com>,
Brendan Higgins <brendan.higgins@linux.dev>,
David Gow <davidgow@davidgow.net>,
damon@lists.linux.dev, kunit-dev@googlegroups.com,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-mm@kvack.org
Subject: [PATCH v3 0/2] mm/damon/core: preserve quota state when constructing schemes
Date: Mon, 28 Sep 2026 01:58:32 -0700 [thread overview]
Message-ID: <20260928085835.7675-1-sj@kernel.org> (raw)
From: Karl Mehltretter <kmehltretter@gmail.com>
damon_commit_ctx() first commits the running context's parameters to a
temporary context for validating proposed updates. Constructing the
temporary schemes clears the running schemes' quota state because
damon_new_scheme() initializes the quota passed as a parameter before
copying it to the new scheme. Even an update later rejected with -EINVAL
loses the running quota state.
Initialize the new scheme's copy instead, and add KUnit tests for the
constructor and for accepted and rejected context updates.
Note: below are test results and changelogs that could be removed from
the final commit log.
In the v1 live test with damo, a scheme with a plain 64 KiB size quota and
a 60-second reset interval uses its quota, and a full "damo tune" with
unchanged parameters then lets it try another 64 KiB within the same
window. With the fix, sz_tried stays at 64 KiB.
KUnit was rerun after the rebase on x86-64 and i386. With only patch 2
applied, the two new tests fail. With the fix, all 46 DAMON KUnit tests
pass on both architectures.
The v1 DAMON selftests showed no new failures (QEMU TCG guest; the
wss_estimation test missed its accuracy bounds with and without the fix).
Changes from v2
- v2: https://lore.kernel.org/20260924201615.4478-1-kmehltretter@gmail.com
- Collect R-b: from SJ for patch 1.
- Rebase to latest mm-new.
- Add a note for starting point of test results and changelogs.
- Fix typos in patch 1: s/detault/default/ s/occationally/occasionally/.
- Update series subject prefix.
Changes from v1
- v1: https://lore.kernel.org/r/20260921003047.12041-1-kmehltretter@gmail.com/
- Collect SJ's Reviewed-by for patch 2.
- Explain the running-context validation in the opening paragraph.
- Clarify which quota is passed as a parameter and use "commit" for the
context operation.
- Point Fixes to commit 60bd24f272d0 ("mm/damon/sysfs: test commit input
against realistic destination"). Drop the redundant stable version
comment.
- Rebase onto mm-new. No changes to the fix or test logic.
Karl Mehltretter (2):
mm/damon/core: preserve the quota passed to damon_new_scheme()
mm/damon/tests/core-kunit: test preservation of quota state
mm/damon/core.c | 6 +-
mm/damon/tests/core-kunit.h | 107 ++++++++++++++++++++++++++++++++++++
2 files changed, 110 insertions(+), 3 deletions(-)
base-commit: 0fa0454423ab5bbe40db5783aab8ae29b40adf89
--
2.47.3
next reply other threads:[~2026-09-28 8:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 8:58 SJ Park [this message]
2026-09-28 8:58 ` [PATCH v3 1/2] mm/damon/core: preserve the quota passed to damon_new_scheme() SJ Park
2026-09-28 8:58 ` [PATCH v3 2/2] mm/damon/tests/core-kunit: test preservation of quota state SJ 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=20260928085835.7675-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bijan311@gmail.com \
--cc=brendan.higgins@linux.dev \
--cc=damon@lists.linux.dev \
--cc=davidgow@davidgow.net \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=stable@vger.kernel.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
all inboxes | Powered by JetHome®