tests: fix schemes-filters cleanup and prcl sub-test#49
Merged
Conversation
added 2 commits
May 22, 2026 16:52
test_filters() starts DAMON via 'damo start' and then runs the workload. If the subsequent RSS check fails, it called 'exit 1' without stopping DAMON or killing the workload, leaving kdamond running. The next test then failed with: $ ./tests/run.sh [...] FAIL record-validate "sleep 5" 5 none sysfs (could not turn DAMON on: [Errno 16] Device or resource busy) Fix the three failure paths in test_filters() to stop DAMON and kill the workload before returning, and propagate the return value to the caller. Also add a defensive DAMON stop at the start of run.sh. Co-developed-by: Wang Lian <lianux.mm@gmail.com> Signed-off-by: Kunwu Chan <kunwu.chan@gmail.com>
The prcl sub-test used 'damo start -c prcl_damos.json' without a target, which defaults to paddr (physical address space) monitoring. The scheme targets regions in the 0th percentile (nr_accesses == 0). After the arm64 TLB fix, access detection works correctly and the workload's pages have non-zero nr_accesses, so they are no longer in the 0th percentile and the scheme never applies to them, causing: $ ./tests/run.sh [...] FAIL schemes-filters sysfs (prcl doesn't work: 1049324) Fix by starting the workload first, then targeting it explicitly with its PID, which switches to vaddr monitoring and accurately tests pageout functionality. The prcl_no_anon and prcl_no_cgroup sub-tests continue to use paddr; their purpose is to verify that DAMOS filters block pageout, and the expected result (RSS stays high) is satisfied regardless of whether the scheme matches. Co-developed-by: Wang Lian <lianux.mm@gmail.com> Signed-off-by: Kunwu Chan <kunwu.chan@gmail.com>
Contributor
|
Awesome, thank you for this great PR. Looks great to me. Merged. |
Contributor
|
Also, this change may even closing this issue: #49 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix two issues in the schemes-filters test that caused cascade failures
when running
./tests/run.sh.Problem 1: stale DAMON on test failure
test_filters()starts DAMON viadamo startand then checks theworkload RSS. If the check failed, it called
exit 1withoutstopping DAMON or killing the workload. The next test then failed:
Fix: stop DAMON and kill the workload before returning on all three
failure paths, and propagate the return value to the caller. Also
add a defensive DAMON stop at the start of run.sh.
Problem 2: prcl sub-test uses paddr by default
The prcl sub-test used
damo start -c prcl_damos.jsonwithout atarget, defaulting to paddr monitoring. The scheme targets the 0th
percentile (nr_accesses == 0). After the arm64 kernel TLB fix [1],
access detection works correctly and pages with non-zero access
counts no longer match, so the workload pages are never reclaimed:
Fix: start the workload first, then target it with its PID, which
switches to vaddr monitoring and tests pageout directly.
[1] https://lore.kernel.org/damon/20260520113934.xxx/
Tested on
./tests/run.shpasses all tests./damon-tests/corr/run.shpasses all testsCo-developed-by: Wang Lian lianux.mm@gmail.com
Signed-off-by: Kunwu Chan kunwu.chan@gmail.com