From patchwork Wed Feb 7 20:31:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13549050 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61167C4828F for ; Wed, 7 Feb 2024 20:31:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BF4FC6B0071; Wed, 7 Feb 2024 15:31:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BA4896B0075; Wed, 7 Feb 2024 15:31:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A939D6B007D; Wed, 7 Feb 2024 15:31:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 9B9F06B0071 for ; Wed, 7 Feb 2024 15:31:44 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 278BEA23FA for ; Wed, 7 Feb 2024 20:31:44 +0000 (UTC) X-FDA: 81766153728.04.01FB754 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id 7218412000C for ; Wed, 7 Feb 2024 20:31:42 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mgtfnZ2H; spf=pass (imf29.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707337902; a=rsa-sha256; cv=none; b=ZJdyX3GM4p8uSxgT9Wg844gkDVx414IRUJi6qn2O426KWCd0BqW2AUqt0eFQoQ+W1+K1z4 e1zGJ/gI58o6rOP31/ZrSr7dMe5nUaWZW3vW96wft+Pyew5RXMcXBxbn+WEKmaOWhqHZmA amLzGDLM9bJEuHIS8fB7XvpzWCkSKHU= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mgtfnZ2H; spf=pass (imf29.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707337902; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=6nCAhGKy78Md1hAvtLIwRo0XQSFPD/judEiI3JdiQfg=; b=AgtHrxIfay3YlitinCBp0JputWLRKcNROeg4PurdpyduzDOe2Qt7sA/uLkEmKLNYQwWp03 7QX5G99lvyl4DbRuaYBa5ACGeaOwkouPEBndI/2raf3oIH2X6CcMqPRix63thb36RFyXb4 1Buf2PqqH22qCO2GSfOR0lwVWwjENA0= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5A55D61A8E; Wed, 7 Feb 2024 20:31:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 520F1C433C7; Wed, 7 Feb 2024 20:31:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707337900; bh=SF63Uy/W6gSlPDVcToCt1nQO7SUTdRa2P7SsA0ShYjQ=; h=From:To:Cc:Subject:Date:From; b=mgtfnZ2HwNFkfRgtZgwVLxmVy7gbrtkqYaqlJBri8LGwuN+Oczb0VxW9S4xI0Ro7B OLA5fWfLDJeod7M0QdiFlXoXFHE8WUQ0YsJafPw8451Wbm1ZfRWbv0ZqvmL8fj2WdW YSOPTnfvNxO1co5/RMQDwIRUVfRARe0qv9Z3JO5/FmFBxR0TdpxptOzSchuVRo03N/ bn+hrIlWXRDBi4pOJu6AkIvsBlHClBmtDbsWAAKGP1K9yshrtCRulMj5x0nZNw0ZGJ dZKCiiQ0OVHqxAamNIHI3Krog1qMn0FsaxylaPdVKtCgikasmTboNe6yUq6mEJ0leH j2aN5mXc5STYQ== 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/8] selftests/damon: add more tests for core functionalities and corner cases Date: Wed, 7 Feb 2024 12:31:26 -0800 Message-Id: <20240207203134.69976-1-sj@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 7218412000C X-Stat-Signature: yaa83ihtt48rto45qw1qqx71qfdb4wa4 X-Rspam-User: X-HE-Tag: 1707337902-597602 X-HE-Meta: U2FsdGVkX19AkLlKfj7rEV1AFpwqW6Gx8ZO13vFXFeZO6R7mO62F8qqdVpNczMf8MTqNOUeIEwssfOk7C1pG4gVUlRkab+11+RDAYLNPyMhXD2zOAjI9Rn2U+SKWdf9pxKUnhyF17zILDKFqo+DBBIUtzS1fPEhUoQICtWfxvn80g76IUyLtFXbYSJ56bQHlbm1XJwEeAPVjXiwQap85n6CPHO5EzHqv0cmVSTl4gNJRyfRN1ce2BbIts/u/TFf/GlkDvrgzNdumR5n3zLirZKJD9fQkYt9qO8OXc6CQC1T2/bSj4kuWXskjR64yKWX3/tHWoAcCqU0SwxE0mn7B67kXMphRCGEPE6qR13CFHaA0FWEmLOPkgofV22QtS0es60dYQbR+SucPixv3zN4O/Q/9zY+/gg1jF5GHwuGbyqLlpaWaTlK/h7ZN/HNjcPzmSQR2W7pKhTGL/v4ChmPWjTjembTyA3Qy4OSBoLtrWg2y9woU/VOejlLiS5EyHI9qnLVv/Ou8qZSkb9m+HfDeXFfzkFYzTXS5rvIm1+eHrOEQp+PaZwZhMjpRMgTW5iMopW7sFKaXb7ZsLB0XaXBp9At5GBD8xRpVGxIiqm0Bn9KNVllNpv5+TFg4NaN5LIp8Miq+R7NTK89rmYl5aUUS8uX9cWfgEWG0YlgnW2IezaMBo5I2X+NgBR48JBvA90LnrsGFqisXMtCdus4kgCJvFAODqcI/3Dshs8YwrfxnVyqQqcDzjK357mMHuC86Wt1ElnjcrLG7SyZbeIaZfkReyRHYZBJ/Wt/UGNj6Zml3FoiMt2SQ5s2pVizojncdatmPzD5VaiVBlGt0fxi4qZ7Lcyby7te94k3ISRzckhNiTB6ws1QhhCbq6HvuzuDzbrXlpb0vu64dLzBRqOPu8IAjKpYHB06N7dVdonyCECzs+pSC4CUwBhIIqi4aMVJBIZLU2+tHF8NdCbYwbuxyDkp X6l0I1ny HasUmCRYGK21J1KvQIfKz8oPlxLbkGhmTzByABXSQNpzfR/JeUY8LDBkfbksFvaBy+GSI7erybFFq1gtmh6SO4PwNQh0r77XdNrRk2m2vEcW8xQMwz2kQcs7OLTgSj+iKQIdNWf8xUj7iLk1LOkLmkBTcr71STTxsZXCSM0EMgAl9T6WyV92pi7vjNw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Continue DAMON selftests' test coverage improvement works with a trivial improvement of the test code itself. The sequence of the patches in patchset is as follows. The first five patches add two DAMON core functionalities tests. Those begins with three patches (patches 1-3) that update the test-purpose DAMON sysfs interface wrapper to support DAMOS quota, stats, and apply interval features, respectively. The fourth patch implements and adds a selftest for DAMOS quota feature, using the DAMON sysfs interface wrapper's newly added support of the quota and the stats feature. The fifth patch further implements and adds a selftest for DAMOS apply interval using the DAMON sysfs interface wrapper's newly added support of the apply interval and the stats feature. Two patches (patches 6 and 7) for implementing and adding two corner cases handling selftests follow. Those try to avoid two previously fixed bugs from recurring. Finally, a patch for making DAMON debugfs selftests dependency checker to use /proc/mounts instead of the hard-coded mount point assumption follows. SeongJae Park (8): selftests/damon/_damon_sysfs: support DAMOS quota selftests/damon/_damon_sysfs: support DAMOS stats selftests/damon/_damon_sysfs: support DAMOS apply interval selftests/damon: add a test for DAMOS quota selftests/damon: add a test for DAMOS apply intervals selftests/damon: add a test for a race between target_ids_read() and dbgfs_before_terminate() selftests/damon: add a test for the pid leak of dbgfs_target_ids_write() selftests/damon/_chk_dependency: get debugfs mount point from /proc/mounts tools/testing/selftests/damon/.gitignore | 2 + tools/testing/selftests/damon/Makefile | 5 ++ .../selftests/damon/_chk_dependency.sh | 9 ++- tools/testing/selftests/damon/_damon_sysfs.py | 77 ++++++++++++++++-- .../selftests/damon/damos_apply_interval.py | 67 ++++++++++++++++ tools/testing/selftests/damon/damos_quota.py | 67 ++++++++++++++++ .../damon/debugfs_target_ids_pid_leak.c | 68 ++++++++++++++++ .../damon/debugfs_target_ids_pid_leak.sh | 22 +++++ ...fs_target_ids_read_before_terminate_race.c | 80 +++++++++++++++++++ ...s_target_ids_read_before_terminate_race.sh | 14 ++++ 10 files changed, 403 insertions(+), 8 deletions(-) create mode 100755 tools/testing/selftests/damon/damos_apply_interval.py create mode 100755 tools/testing/selftests/damon/damos_quota.py create mode 100644 tools/testing/selftests/damon/debugfs_target_ids_pid_leak.c create mode 100755 tools/testing/selftests/damon/debugfs_target_ids_pid_leak.sh create mode 100644 tools/testing/selftests/damon/debugfs_target_ids_read_before_terminate_race.c create mode 100755 tools/testing/selftests/damon/debugfs_target_ids_read_before_terminate_race.sh base-commit: f51e629727d8cc526a3156a2c80489b8f050410f