From patchwork Tue Jun 25 18:05:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13711789 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 5FA9AC3064D for ; Tue, 25 Jun 2024 18:05:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 43E716B009C; Tue, 25 Jun 2024 14:05:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 327766B009E; Tue, 25 Jun 2024 14:05:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 152756B009F; Tue, 25 Jun 2024 14:05:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E76066B009C for ; Tue, 25 Jun 2024 14:05:50 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 8A11DA2097 for ; Tue, 25 Jun 2024 18:05:50 +0000 (UTC) X-FDA: 82270189260.11.350CFE4 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf28.hostedemail.com (Postfix) with ESMTP id D685FC0005 for ; Tue, 25 Jun 2024 18:05:48 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=io9S9UFU; spf=pass (imf28.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=1719338737; 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:in-reply-to:references:references:dkim-signature; bh=DfegfZhr4USgWzRMX9rKcxHdyxOi3V6ymvitcsExA+s=; b=wfR4bsJcFVlvIBRJZOapc1oEeAfsFup+68xE2x6rKN5aYceAHNSH45xua9B/4yarbL/Raq XRobXAHi04XT1jRMCf0yqR378s+EIrSfA3deIQkiAgRVHbuRAtan1pfjyRjyoTz5w17L4o 3rMQL6I0pZ/NFFYSZY9HvCZcnmsmRBk= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=io9S9UFU; spf=pass (imf28.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=1719338737; a=rsa-sha256; cv=none; b=6fQoERsTiCmpdmcetipzuOPESWTS9y0u7Az8woEITmoavwyr73mA90xAYwOaCkW5bph084 WcONQ2bKvUGoxt3tCHQ7aMjNEUsWdEAiFFjM0p3XeQ7jCnophRLcivoDNmYRQr+XQ3ufgc BPQ84vHpyzNjQBNUllGXpqCFeToG8Po= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id F109D616DE; Tue, 25 Jun 2024 18:05:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F431C4AF09; Tue, 25 Jun 2024 18:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719338747; bh=lD5FdO0GjKR1qAYavsvEm7e4xnZladhl0pTurzLbRRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=io9S9UFUNH/oAQ5pEtWW2n7hXGpqwhp/fGIEQ4TEsD4moQYtEuxh0rGfSwoF5dlKh 81yPdqkG+YR8pdg/Kq1VN3ax7i2owrWD++iqCGuVwBYMUVg+OInJZTEMAB5xNO3UBg U+mrLmHEBEBv2kSmO6f3OhnpgB4CjL66fiWDyqPkTPScI0gkkgGgA0FL6sXyxYke8/ 1lowHFMMg3OghChgQjYcU4uGdU0Y+ZPMG3a8kJHV7Lmf4cstkUry4Tk8XCZbO8fiMe uUAAzjhMncsMCLLFF7tjPxWQwEupciLGjdlqz3idRAaJ218xGX1pWiyOMmXaQXNaBX l0XLTgdhNjuGg== 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 5/8] selftests/damon/_damon_sysfs: implement kdamonds stop function Date: Tue, 25 Jun 2024 11:05:35 -0700 Message-Id: <20240625180538.73134-6-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240625180538.73134-1-sj@kernel.org> References: <20240625180538.73134-1-sj@kernel.org> MIME-Version: 1.0 X-Stat-Signature: a19b9gjrk47cxgk7axbzs7t94pqoo5cd X-Rspam-User: X-Rspamd-Queue-Id: D685FC0005 X-Rspamd-Server: rspam02 X-HE-Tag: 1719338748-848553 X-HE-Meta: U2FsdGVkX1/ZcKzpbW0+Fc35eaoPb/yVthvEDiMFXj6KKSsrwGjq6eN2Dp/at2GRrrpeZ756NR9cJkZsPeyrjzEMYPmtOzDKI/wwOSEzGubELnJ4yua2Itbtr/7YAs/BvQ4EFn0hy92+XS8ME2q1d3nxNZH8AAUJY9cZiqzLxD0AmO0GbnPgKq3A1AL1NrYlXvhfz0FpJ1c8bZjZjstb0DhofGgVO0gUtlLNU98knYM+WPycYW8iwqx/d/7BlBQ2Qy3L0mUzuK21T7kHlayONWVX7OG2mStGyW6zw+oRtc48VXouJFajC7kYMMi42il//VOYtBeHdGj31tcw5svXXSK5DJOKZSNOMmVulQmFZZj46HKRuvN2ez73qkzyfziaAYvff7SJn6OOVQv2Cjb5QYCTsnUzxLNklvcf9ef4Cng4xNkA1KVtHdyUkZYG9bB3VeBGnw2xz9Cs7USRUpSPg50ZfuQn+bCArBdO6Bmxu5w2O5bjyTMouIMniZ1z+8bB1riQ281SUinL530Ux+dGNk2CLsTfNA8GWjNiMpJ3cKoEXjW7+iD93vRRkzCihNIfFYfM6cIdWbYEJo9YiVIxtxEq1BdwqdHNq4Y5LItVL3LUTW6+hKcoIvirUdIa+wRQ7Q+qcvKoE0HAngfVPsVFUq2mnMDDT4shRpL9WATEsMaSAAPMDBoZyZ8KINi2NGkAxwPognQ8DwnsbzmfFcygqdQ+mSGJByUwuREcjdbZ+XmwVgNSHtmU4wVBR/ZjiMebh8iChFv76BwDogdMEqJmPAabe8BDEqqAjxBtq3Fa82pNFVeE+9QNFaVJSf80O9UJ96sU5FOg1x2lFfR6UaMf4LsqCHlUIRV/OkZH7jKPI8z0Nj+M7EjuluOa6o+Yg3yhhsN48qckOWhFKKcSw4VIB+XQal1/nvJJwt8UbsKL0yOtxMU+yrBwTMxYi5uNOjFVcwW0lbjfyUcLlhkfR/N xV2p4Wm+ qN/Zc9nQbIx/umXNmj6OmGY2DzqWvXe/tiY0BArXkWyu57k0nGxWF6856/DmK+SfcQ3wbd6IGDi9nGsUK8D8+k7x/Je70Ma5rc++HuM2yy7c75TQiJXyv3ogxsABV/Oy+7BRb1lNA8hBUNMP8U1JO18JxWca/CkqIHB8EizqIhN5uouRorr4f7YNJoxjgNgthD8XEG2k10d4Jinh7QTUCLkgKpEKYOGyGTbOKEYz+v5I6G4MgTuakJRfJl87YuefRLuz39UKzsrCxf66wHzDYI0ydJiFdVWhrjvUd 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: Implement DAMON stop function on the test-purpose DAMON sysfs interface wrapper Python module, _damon_sysfs.py. This feature will be used by future DAMON tests that need to start/stop DAMON multiple times. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/_damon_sysfs.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/selftests/damon/_damon_sysfs.py index f975742f29b3..17352b9d204d 100644 --- a/tools/testing/selftests/damon/_damon_sysfs.py +++ b/tools/testing/selftests/damon/_damon_sysfs.py @@ -406,6 +406,10 @@ class Kdamond: err = write_file(os.path.join(self.sysfs_dir(), 'state'), 'on') return err + def stop(self): + err = write_file(os.path.join(self.sysfs_dir(), 'state'), 'off') + return err + def update_schemes_tried_regions(self): err = write_file(os.path.join(self.sysfs_dir(), 'state'), 'update_schemes_tried_regions') @@ -511,3 +515,10 @@ class Kdamonds: if err is not None: return err return None + + def stop(self): + for kdamond in self.kdamonds: + err = kdamond.stop() + if err is not None: + return err + return None