From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B043563C11 for ; Tue, 12 Dec 2023 20:29:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="g8HqhyLr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69D28C433C8; Tue, 12 Dec 2023 20:29:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1702412962; bh=Y2NLRYyOvufcbVngqaXNgHRwmeHa6EGH5J1anucjAqM=; h=Date:To:From:Subject:From; b=g8HqhyLreGCvWGZzvCr9TCGEKfGUwYxhpCxLasnhY8+vEuUXTEZS2rlrPqdmslt5R 4SWrKuAyTYOa+3nYf67eIdmZ0b/4l+yxZ5IhMPqI9qwSItryZdC51eYEBJMrXqC4HE d9rnin8rBRsPfgCj/WijvTPv1HnI92oMTf/lwW1s= Date: Tue, 12 Dec 2023 12:29:21 -0800 To: mm-commits@vger.kernel.org,shuah@kernel.org,sj@kernel.org,akpm@linux-foundation.org From: Andrew Morton Subject: + selftests-damon-add-a-test-for-update_schemes_tried_regions-sysfs-command.patch added to mm-unstable branch Message-Id: <20231212202922.69D28C433C8@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: selftests/damon: add a test for update_schemes_tried_regions sysfs command has been added to the -mm mm-unstable branch. Its filename is selftests-damon-add-a-test-for-update_schemes_tried_regions-sysfs-command.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-damon-add-a-test-for-update_schemes_tried_regions-sysfs-command.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: SeongJae Park Subject: selftests/damon: add a test for update_schemes_tried_regions sysfs command Date: Tue, 12 Dec 2023 19:48:09 +0000 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 Cc: Shuah Khan Signed-off-by: Andrew Morton --- tools/testing/selftests/damon/Makefile | 2 tools/testing/selftests/damon/access_memory.c | 41 +++++++ tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_wss_estimation.py | 55 ++++++++++ 3 files changed, 98 insertions(+) --- /dev/null +++ a/tools/testing/selftests/damon/access_memory.c @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Artificial memory access program for testing DAMON. + */ + +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + char **regions; + clock_t start_clock; + int nr_regions; + int sz_region; + int access_time_ms; + int i; + + if (argc != 4) { + printf("Usage: %s