mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] mm/damon: preserve quota state when constructing schemes
@ 2026-09-24 20:16 Karl Mehltretter
  2026-09-24 20:16 ` [PATCH v2 1/2] mm/damon/core: preserve the quota passed to damon_new_scheme() Karl Mehltretter
  2026-09-24 20:16 ` [PATCH v2 2/2] mm/damon/tests/core-kunit: test preservation of quota state Karl Mehltretter
  0 siblings, 2 replies; 3+ messages in thread
From: Karl Mehltretter @ 2026-09-24 20:16 UTC (permalink / raw)
  To: SJ Park
  Cc: Karl Mehltretter, Andrew Morton, Bijan Tabatabai, damon,
	linux-mm, linux-kernel

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.

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 since v1 [1], following SJ's review [2]:
 - 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.

The series is based on mm-new at ad8b9fe7a502. On damon/next, patch 2
shares context with the PSI goal test [3] and applies with git am -3.

[1] v1
https://lore.kernel.org/r/20260921003047.12041-1-kmehltretter@gmail.com/

[2] SJ's clarification
https://lore.kernel.org/r/20260922120845.44460-1-sj@kernel.org/

[3] PSI goal tests
https://lore.kernel.org/r/20260921020013.33105-3-kmehltretter@gmail.com/

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: ad8b9fe7a5021ee745b61d6d33254a69af65efdb
-- 
2.53.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-24 20:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-24 20:16 [PATCH v2 0/2] mm/damon: preserve quota state when constructing schemes Karl Mehltretter
2026-09-24 20:16 ` [PATCH v2 1/2] mm/damon/core: preserve the quota passed to damon_new_scheme() Karl Mehltretter
2026-09-24 20:16 ` [PATCH v2 2/2] mm/damon/tests/core-kunit: test preservation of quota state Karl Mehltretter

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®