Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/damon/wss_estimation: ensure number of collected wss

DAMON selftest for working set size estimation collects DAMON's working
set size measurements of the running artificial memory access generator
program until the program is finished. Depending on how quickly the
program finishes, and how quickly DAMON starts, the number of collected
working set size measurements may vary, and make the test results
unreliable. Ensure it collects 40 measurements by using the repeat mode
of the artificial memory access generator program, and finish the
measurements only after the desired number of collections are made.

Link: https://lkml.kernel.org/r/20260117020731.226785-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>

authored by

SeongJae Park and committed by
Andrew Morton
57525e59 514d1bcb

+4 -2
+4 -2
tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_wss_estimation.py
··· 8 8 9 9 def pass_wss_estimation(sz_region): 10 10 # access two regions of given size, 2 seocnds per each region 11 - proc = subprocess.Popen(['./access_memory', '2', '%d' % sz_region, '2000']) 11 + proc = subprocess.Popen( 12 + ['./access_memory', '2', '%d' % sz_region, '2000', 'repeat']) 12 13 kdamonds = _damon_sysfs.Kdamonds([_damon_sysfs.Kdamond( 13 14 contexts=[_damon_sysfs.DamonCtx( 14 15 ops='vaddr', ··· 27 26 exit(1) 28 27 29 28 wss_collected = [] 30 - while proc.poll() == None: 29 + while proc.poll() is None and len(wss_collected) < 40: 31 30 time.sleep(0.1) 32 31 err = kdamonds.kdamonds[0].update_schemes_tried_bytes() 33 32 if err != None: ··· 36 35 37 36 wss_collected.append( 38 37 kdamonds.kdamonds[0].contexts[0].schemes[0].tried_bytes) 38 + proc.terminate() 39 39 err = kdamonds.stop() 40 40 if err is not None: 41 41 print('kdamond stop failed: %s' % err)