Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4877993rdb; Tue, 12 Dec 2023 11:48:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IFmuvzpRykIpLgWgLthAULFMM5j6qgf8vrFk4+ZnmWvD2CnoiOkJ6CvCK+BP6Ar9UstxL8J X-Received: by 2002:a05:6a20:4b21:b0:18c:138e:f268 with SMTP id fp33-20020a056a204b2100b0018c138ef268mr3173210pzb.21.1702410521158; Tue, 12 Dec 2023 11:48:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702410521; cv=none; d=google.com; s=arc-20160816; b=Rp2FjGiQS01lgh93feXCCRfpYV25UwR7AC09YIafRLe6iIStL4zclDc76zgMV09jC0 CpZLh4qWPQfWyzzXLOtqi0gRgCpPgNqmCyGg7xbd4q9i9IpoV1t6oo+1BVk5NZiVT1XO WR7ZwaIRzvc8+4ln1qKlEszbZCP4WlrzyIajFMiVjk+2UeLHDnXeOOhDxybhg5LiyE/G iIdKOfvm8waCOc5qssjUEQZ0BLSoZj1c5YFieXH+obZFV0PmqA7otb1Fa8RphaGTSU/W LW6QaBo/pwbFJLX2nFqo11tLDzZenY41W8xT2JzFzG1zxv2Qq2lvDuo7saJ2jYMLFPd5 pIuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CA4JbCE7YEQI1gyfHErRoU9KVI9hcIALel18KkJioyU=; fh=9H4z7/o7y4OLn0xLmjdSk9Pth53+ED/R+iGnGlnIr7g=; b=rp4VjAb6QMY1QtR48REXVdm5B9GfQOsWLjQYAE36cims97DkSvcOYkrCr19GS1JLM3 ceRhKNYhuuMer2tkIs81qXtVzN2K1pRtxBOMF92afbBeNL5mqHj/PyMbICZ/VnSKYE3D DzWe05YUC12PREhxJvxmnt28KAaIFpEP2QGqt1BSmJX47O5ej+3m/e8cb0UEkbxvAiMj V+cp0sC3+apqwDIebru4CLygD344VkLMiBXdbIKkjJTCznwbw8rFfWHZ5wQEWhVdIsoH 6OWUPqcJV8jj4bCf2KUFmNWy8B0PJI0TeyCLXYSXqR0pwqUJtk20ZTU7m/6w6XzVPNe5 O7AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X95NT4af; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id c2-20020a056a000ac200b006cb6fc94847si8305012pfl.172.2023.12.12.11.48.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 11:48:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X95NT4af; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 8BA5A80A97F5; Tue, 12 Dec 2023 11:48:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377123AbjLLTsO (ORCPT + 99 others); Tue, 12 Dec 2023 14:48:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230181AbjLLTsN (ORCPT ); Tue, 12 Dec 2023 14:48:13 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDAE39A for ; Tue, 12 Dec 2023 11:48:19 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCFA9C433C8; Tue, 12 Dec 2023 19:48:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702410499; bh=igd2RnhMFXzUjNiscTu9eDHYyW+3+ewG3ZKhV0p4XGo=; h=From:To:Cc:Subject:Date:From; b=X95NT4afRyAWsTbccHx94B2W6zzknjz9JqcA0ko1z5FUEoNTBl7Ci88oljGXp5l9U +MDcVdzohghe0yxN+qav+YX16YRFRiO+7n0a8yfPKE5Uv67CS+rgZwxKw5LG992pcM lbTYfra/SJ7b4EozxyjCKF1bAGwmlHxKPhxXy1v2Nvs2LbNJMePXF0xOTsZQYoCqfe 42knU6Y/QcMzxziq4TBYGFQRm/HBIjSLfGUfqDg779PmkHUf0g4D2seuunMQv8Iko6 TbOwyb4nfQfs8hqd+lo5mt5Lt7Zr899nMncYM4jKYErwoVCVsm49Znn3CKIpO7n9k1 FjYLmCmvp/u8w== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Shuah Khan , damon@lists.linux.dev, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/5] selftests/damon: add Python-written DAMON functionality tests Date: Tue, 12 Dec 2023 19:48:05 +0000 Message-Id: <20231212194810.54457-1-sj@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 12 Dec 2023 11:48:35 -0800 (PST) Changes from v1 (https://lore.kernel.org/damon/20231212191206.52917-1-sj@kernel.org/) - Fix conflicts on latest mm-unstable tree Changes from RFC (https://lore.kernel.org/damon/20231202000806.46210-1-sj@kernel.org/) - Make the working set size estimation test more reliable - Wordsmith coverletter and commit messages - Rename _damon.py to _damon_sysfs.py DAMON exports most of its functionality via its sysfs interface. Hence most DAMON functionality tests could be implemented using the interface. However, because the interfaces require simple but multiple operations for many controls, writing all such tests from the scratch could be repetitive and time consuming. Implement a minimum DAMON sysfs control module, and a couple of DAMON functionality tests using the control module. The first test is for ensuring minimum accuracy of data access monitoring, and the second test is for finding if a previously found and fixed bug is introduced again. Note that the DAMON sysfs control module is only for avoiding duplicating code in tests. For convenient and general control of DAMON, users should use DAMON user-space tools that developed for the purpose, such as damo[1]. [1] https://github.com/damonitor/damo Patches Sequence ---------------- This patchset is constructed with five patches. The first three patches implement a Python-written test implementation-purpose DAMON sysfs control module. The implementation is incrementally done in the sequence of the basic data structure (first patch) first, kdamonds start command (second patch) next, and finally DAMOS tried bytes update command (third patch). Then two patches for implementing selftests using the module follows. The fourth patch implements a basic functionality test of DAMON for working set estimation accuracy. Finally, the fifth patch implements a corner case test for a previously found bug. SeongJae Park (5): selftests/damon: implement a python module for test-purpose DAMON sysfs controls selftests/damon/_damon_sysfs: implement kdamonds start function selftests/damon/_damon_sysfs: implement updat_schemes_tried_bytes command selftests/damon: add a test for update_schemes_tried_regions sysfs command selftests/damon: add a test for update_schemes_tried_regions hang bug tools/testing/selftests/damon/Makefile | 3 + tools/testing/selftests/damon/_damon_sysfs.py | 322 ++++++++++++++++++ tools/testing/selftests/damon/access_memory.c | 41 +++ ...sysfs_update_schemes_tried_regions_hang.py | 33 ++ ...te_schemes_tried_regions_wss_estimation.py | 55 +++ 5 files changed, 454 insertions(+) create mode 100644 tools/testing/selftests/damon/_damon_sysfs.py create mode 100644 tools/testing/selftests/damon/access_memory.c create mode 100755 tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_hang.py create mode 100755 tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_wss_estimation.py base-commit: 091b8c820de390a6235595bdb281edab63b9befe -- 2.34.1