Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4859652rdb; Tue, 12 Dec 2023 11:12:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGpR/fIs82Uope618zSfBNVR3T1z8FyAWrtYD1+lLE6hNVoDPvxpb1/+9ZQ/bEkvCWzaf8n X-Received: by 2002:a92:c604:0:b0:35f:6849:53be with SMTP id p4-20020a92c604000000b0035f684953bemr703876ilm.61.1702408343517; Tue, 12 Dec 2023 11:12:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702408343; cv=none; d=google.com; s=arc-20160816; b=Vzs1i2YFmvj5udZ6k2A4qSggHZ8C2KmDDcSLVV9tLnU3nmvqzEOjghg+lRh3+NMUA0 yhzpqFT3PZM0QRjXxCW2aKD3g7VYFqauV11CbAV2snMiOSJxTDGaVYMCmgX4SCknDCDx u8H1kvRXPgAuEwm3eFU2ZdcEy0BjMaKXcxQWu6v9kgxuyafa14vMkR96Ul7tpgOgqm8b dKoZLaanf9puTueSG9wUGtJJyrq3Nn+ZO6tQFddb9XPZrwllBjNMlhjWiBue3PiDW7tq dNnZJf6tMYAUxq8LZE4tXizOdv6Wzw2vIDyi+uu7rEjbcB2K6CK/kNjHmOXg9NKt6DiY /HjA== 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=sWvEIlJSWFiw21NpTm+OaaSQ2s3/tHxIehSTv11tqCw=; fh=9H4z7/o7y4OLn0xLmjdSk9Pth53+ED/R+iGnGlnIr7g=; b=0+uPGVoOuX0a0q3oh+K9cAvdJaLbrfKYMnor0y+57oEzCH05IijU/pmwe4/IGP+tGY BL9mAD4rPRzut/SvqnGT6cmYcvWS9ZmUyfx/M3eQpdhD374lCDTT5DJf5hm/6f3Ropbn oyPFQnD0pykvW4G2W2SJfhXqd1AliUPpoB4VUWjISyN6vRY9mqgHgrQdw1RuPD8EYXco 7deKEkn7nvG0Yd2ops4231UGAhEL9uBystHCG7bIUlpndkQiCDyOCDcX98sJ1RwQWkyA U7sKxL0cvGIqONSIRhaCRM+b9REAxn76RrFNbc2d+EA+6hgDfccEphU2wjBfpwmnt4+j sVyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="nJ/ZB6cd"; 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 l9-20020a6542c9000000b005c21fbab567si8120945pgp.659.2023.12.12.11.12.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 11:12:23 -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="nJ/ZB6cd"; 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 7F61A80A90E5; Tue, 12 Dec 2023 11:12:20 -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 S1376984AbjLLTMF (ORCPT + 99 others); Tue, 12 Dec 2023 14:12:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230370AbjLLTME (ORCPT ); Tue, 12 Dec 2023 14:12:04 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5901D91 for ; Tue, 12 Dec 2023 11:12:11 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67E6EC433C8; Tue, 12 Dec 2023 19:12:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702408331; bh=6tke9Mw73/PmV6sucCIPXGu5OGZe4EV0PkE+FQKIYKI=; h=From:To:Cc:Subject:Date:From; b=nJ/ZB6cdaAzYm2iVfPA9pB4Kwf3IsNZ2cd5012uIiLCKnE8RjQKaTJKbdn/8HggFL JvHxekh3fKJhlTDeQ/zSEfKQ1OWLhCItYUItlw4h952ge07YwQt/pxbaaLZkUKcSO1 y2M6qwdV5GYGwNYGUk0g7gmKprHI11sKdJcJnpMJPY8ObZmVgS9EQW5V3IByuGOUMA srxSoN8X7xIHv06AGfa73Sp/Fjt1qzTEbq10E/vnpXFmnnPTRvSE4JQxCHPOzfM5nX 0NAg5wdjmhAJ3TTdZGF0MpX27kxvyl+Ra8R4VU2barlWQvfHh73WyMAWzgahAqKX/C f2pV37Ciqcc1Q== 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 0/5] selftests/damon: add Python-written DAMON functionality tests Date: Tue, 12 Dec 2023 19:12:01 +0000 Message-Id: <20231212191206.52917-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:12:20 -0800 (PST) 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: 5794dfaf6d1be564b0912d51d8a714baff329495 -- 2.34.1