selftests/damon: add a test for update_schemes_tried_regions sysfs command
authorSeongJae Park <sj@kernel.org>
Tue, 12 Dec 2023 19:48:09 +0000 (19:48 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 20 Dec 2023 22:48:13 +0000 (14:48 -0800)
commitb5906f5f7359f561c5915dc146ced1bc2733401c
tree445418f1f4729ea2080c5ad8effff23bffed35d7
parent3402c6ce398e33bf1733f619756dd068ca2e2aa5
selftests/damon: add a test for update_schemes_tried_regions sysfs command

Add a selftest for verifying the accuracy of DAMON's access monitoring
functionality.  The test starts a program of artificial access pattern,
monitor the access pattern using DAMON, and check if DAMON finds expected
amount of hot data region (working set size) with only acceptable error
rate.

Note that the acceptable error rate is set with only naive assumptions and
small number of tests.  Hence failures of the test may not always mean
DAMON is broken.  Rather than that, those could be a signal to better
understand the real accuracy level of DAMON in wider environments.  Based
on further finding, we could optimize DAMON or adjust the expectation of
the test.

Link: https://lkml.kernel.org/r/20231212194810.54457-5-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/damon/Makefile
tools/testing/selftests/damon/access_memory.c [new file with mode: 0644]
tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_wss_estimation.py [new file with mode: 0644]