Message ID | 20231202000806.46210-1-sj@kernel.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1495352vqy; Fri, 1 Dec 2023 16:10:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+nIFr+9kLihPeuu/+whS/CVPdX4qHqEnjr2Daz7B7Pf8mmXeBQnvpz9G/bn3fHi77klx1 X-Received: by 2002:a17:90b:1e04:b0:285:e32d:d2eb with SMTP id pg4-20020a17090b1e0400b00285e32dd2ebmr321438pjb.16.1701475828159; Fri, 01 Dec 2023 16:10:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701475828; cv=none; d=google.com; s=arc-20160816; b=dSeRXmNwwUdYR7hbxZ8Re42NfkCtmCYyZ8CCRBJBhNSpRYikfiWgOxvq08sWJQnbS0 HajrnuvjalWoUv1VBAcU9B0gcb6bMfXBnJVVS0Jltt/LhLwGpl/goanCxTu6fI2QNFpZ HdzgCi6sSlUU1jWW5KBDiGtd4XBNnceoT0JvuTtpNqI5eU87ID9Jgpsj6x57OmlNwQwN wLXbUW6ZtEPljAmGT7bp0cv4jNf4oOHB1x/vD5busmSvHmV5OdazWMUDrH1W85LG0cg9 xV9f7xW13qD3q84C3w/wDIoth6uwc0Wae82RBVzvmk/cmjTmRQRJOr0RzfYtgi7XMvKg 5aHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=ovjBgyZCgseCEX5Oq1lZRYgY32VGTRqoe5THrvpWPpo=; fh=W+de0FjxL1MlRh6Ly02q9tA2/xTz2DOJsg1VkI/mHfI=; b=ynirYOKRVZib9JgfJNjZVz0xXyiiboOCPFUg9T2OrQ9KIx+oafWmsvFwxiSYiNsiNt xUDwj8EYeSAI6Wdgq7auyI5pCHWSwpVUM0lTkMbWU1++it9+2KBpvANKtflAHy2GC00d cDGX2sazU2ntPO50Fg/qR0XAXlxz9nBOokHyIboRr1rPP5ESVzgfGiWcbXwLSxgJQiEg H391ZLGiZPsQzgQQ8tmYg/aZ5vSF+Ld2L9jknB1NrV8OLhgNd2wVb6yYTVwF4+oAtTx7 rz9rgl4qJ2wS8OCP46RQxX3e/vmhY8/jdgnyd8Lm5sN9UCVYCNkzo5xyFZwGWu6jgbAW bV9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=r8GrkEMH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id d10-20020a17090ab30a00b00285a2b58468si6328664pjr.128.2023.12.01.16.10.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 16:10:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=r8GrkEMH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id D80FC80EA959; Fri, 1 Dec 2023 16:10:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441942AbjLBAKL (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Fri, 1 Dec 2023 19:10:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235401AbjLBAJ5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 1 Dec 2023 19:09:57 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 049143843 for <linux-kernel@vger.kernel.org>; Fri, 1 Dec 2023 16:09:05 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CF17C433C7; Sat, 2 Dec 2023 00:08:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701475689; bh=A1C2zs2bNcPgxvWmPkcCx7AYSR8F7j9qABqqkUnLgSo=; h=From:To:Cc:Subject:Date:From; b=r8GrkEMHKqnkzCBxXV6dk0fxj2hTrFflggLRLPq6CrikzGUQ5hYicqP17L4pqk5NL Kvqe9zz5t9W1mV8znjB0kuJ4IkkBiUTPOonMYIk3B+hPQqFdmt9wEd6qBojTO6X6y3 VaF7fIoMCcnsZ6IuXrbJQ6Q22BzyAY+dfkcgJBrg76baKN3JK/XJx8b+rQimNIWkr2 FI0XLIJZ9d9eDnKddcwIzMG+PHxfpY8uOfAZBS92pH3kTqaovu87UFYYgPaoOV+2iX mUSzyhjCX3Be3paIV1thkachdpMZGQgEWmMK9DDpQFtn8QRq2Oz5CEE4I/GNzG/gyn Xg6V2D4b6/Rrw== From: SeongJae Park <sj@kernel.org> Cc: SeongJae Park <sj@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Shuah Khan <shuah@kernel.org>, damon@lists.linux.dev, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 0/5] selftests/damon: add Python modules for DAMON control and functionality tests Date: Sat, 2 Dec 2023 00:08:01 +0000 Message-Id: <20231202000806.46210-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=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 agentk.vger.email To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 01 Dec 2023 16:10:20 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784126717827228352 X-GMAIL-MSGID: 1784126717827228352 |
Series |
selftests/damon: add Python modules for DAMON control and functionality tests
|
|
Message
SeongJae Park
Dec. 2, 2023, 12:08 a.m. UTC
DAMON provides almost all control to the user via its sysfs interface. For that, the interface provides plenty of files and hierarchies. The interface is simple enough to be controlled by shell commands including 'cat', 'echo', and redirection. However, due to the number of files and the hierarchies, doing that repeatedly is quite tedious. As a result, DAMON selftests are containing only simple test cases rather than real functionality tests. Having a wrapper script that can be reused to implement more functionality tests could be helpful. Writing such wrapper with shell script might be challenging and not easy to further maintain and extend for future DAMON interface extensions, though. To this end, implement a Python-written DAMON sysfs interface wrapper that could be easily managed and extended for future DAMON interface extensions. Further implement one simple functionality test and a corner case regression test for a previously found bug, using the wrapper module. In fact, the bug was found by the test this patchset is introducing. Note that the Python wrapper is not supporting full features of DAMON interface, but only some of those that essential for the tests that this patchset is introducing. The wrapper would extended to support more features, but only with essential ones for such future tests. The wrapper will hence keep being simple, small, and constrained. For convenient and general use cases of DAMON, users should use DAMON user-space tools for such purpose, like damo[1]. [1] https://github.com/damonitor/damo Patches Sequence ---------------- This patchset is constructed with five patches. The first three patches implement the Python-written DAMON sysfs interface wrapper in small steps. The basic data structure (first patch), kdamond startup command (second patch), and finally DAMOS tried bytes command (third patch). Then two patches for adding selftests using the wrapper 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: add a DAMON interface wrapper python module selftests/damon/_damon: implement sysfs-based kdamonds start function selftests/damon/_damon: implement sysfs 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.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 | 48 +++ 5 files changed, 447 insertions(+) create mode 100644 tools/testing/selftests/damon/_damon.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: 1be383c41197b82cfd51b2edc7ee515c0b786496