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

damon_new_scheme() initializes the caller's quota in place before copying
it. When damon_commit_ctx() clones the running context for validation,
the quota pointer belongs to a running scheme. Constructing the temporary
scheme therefore clears the running scheme's quota state, even if the
proposed update is later rejected with -EINVAL.

Initialize the new scheme's copy instead, and add KUnit tests for the
constructor and for accepted and rejected context updates.

In a 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.

With only patch 2 applied, the two new tests fail on x86-64 and i386.
With the fix, all 43 DAMON KUnit tests pass on both, and the DAMON
selftests show no new failures (QEMU TCG guest; the wss_estimation test
misses its accuracy bounds with and without the fix).

Karl Mehltretter (2):
  mm/damon/core: preserve the caller's quota in damon_new_scheme()
  mm/damon/tests/core-kunit: test preservation of caller quota state

 mm/damon/core.c             |   6 +-
 mm/damon/tests/core-kunit.h | 107 ++++++++++++++++++++++++++++++++++++
 2 files changed, 110 insertions(+), 3 deletions(-)


base-commit: 185111f116aabf202d12ce440c0f6e9bae073514
-- 
2.53.0


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

end of thread, other threads:[~2026-09-22 12:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-21  0:30 [PATCH 0/2] mm/damon: preserve quota state when constructing schemes Karl Mehltretter
2026-09-21  0:30 ` [PATCH 1/2] mm/damon/core: preserve the caller's quota in damon_new_scheme() Karl Mehltretter
2026-09-21 17:11   ` SJ Park
2026-09-22 12:08     ` SJ Park
2026-09-21  0:30 ` [PATCH 2/2] mm/damon/tests/core-kunit: test preservation of caller quota state Karl Mehltretter
2026-09-22 12:28   ` SJ Park

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®