From patchwork Wed Feb 7 20:31:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13549052 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 65121C4828F for ; Wed, 7 Feb 2024 20:31:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D7E66B007D; Wed, 7 Feb 2024 15:31:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7385C6B007E; Wed, 7 Feb 2024 15:31:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5D9E36B0080; Wed, 7 Feb 2024 15:31:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 4C0F36B007D for ; Wed, 7 Feb 2024 15:31:46 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 20553A235B for ; Wed, 7 Feb 2024 20:31:46 +0000 (UTC) X-FDA: 81766153812.13.F1B47E6 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf13.hostedemail.com (Postfix) with ESMTP id 5AF1820015 for ; Wed, 7 Feb 2024 20:31:44 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Fi0iIujP; spf=pass (imf13.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=1707337904; a=rsa-sha256; cv=none; b=ahDIPF1+DAS1N37BE2L2rJPfzSPgQgvCIvSpb+4+ZHunwMqf8d3FmGJtK8CCEgRDw+cf3x FKKmnea2A9ZNqrXhfPhFcNTuxByFv7e4eORKxam0v2FH+byEo8SmoMex+qWmpxBiTd/+JN xEr76EbOgu8s3miGUv2J02CxX4/TAnA= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Fi0iIujP; spf=pass (imf13.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=1707337904; 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=lqk+XrNBIXzsY9QkTuWpsp4fsxkH9nn7jyu/kZayx0c=; b=nXcnII4pZRFWj6N5ZzKkV0g59M+7BnrRpF2Q4zp3No8iUnPzK8bezUXJss3iQE2uB9GrWY ZoB6827wsfTqUjjVZpyi/7VquPh8L2WQTVVsWwLwLNCcphyH4rbCIFJcpEpi2k9fWcwqp2 AKCaQCai9bJRGyTnOSPt5aaBJlZUtgA= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 67DE861A9D; Wed, 7 Feb 2024 20:31:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8F1EC43141; Wed, 7 Feb 2024 20:31:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707337903; bh=9lLmi3bov7hQSKSz6Wm19r7FnAY+g94q4B/k/Jgsk9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fi0iIujPz1cj5u9k8DV6O6k6jYHVEQy6PRbsmappiAAOUQnYijCrUO8m+mPpuZQ/X /Qo1XhekVUHY0pnANoHsgiT0y8eK/BMSLC0y9cvyLOUdXjSE4Z5pGSRSMoGYHhyAim 6ciDGu9LMatd++0cRpr5guC30UwMHR2ZkSRBnXrH+P2hqXseTOV9V0AYm4ptQ+1oR8 WyrAKtkKkKNbHEftXNZBqMKYhKIrCO073GUohgJLzwsRXP5cFQ37mbbhO3MOD+Hjea vWnP8dF05TL/cauWKBUB90aZFB1nilt2afMb5jOh3Dw+y0IppRqhHOpKyNog663RqN X4qIwvmvgRO/A== 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 3/8] selftests/damon/_damon_sysfs: support DAMOS apply interval Date: Wed, 7 Feb 2024 12:31:29 -0800 Message-Id: <20240207203134.69976-4-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240207203134.69976-1-sj@kernel.org> References: <20240207203134.69976-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 5AF1820015 X-Stat-Signature: ykayhjpenfu8i1ogyc5orndo95i7itrj X-Rspam-User: X-HE-Tag: 1707337904-55177 X-HE-Meta: U2FsdGVkX19glFr919mH7W9+f3fhHYMDnaYb9kKio2xFD/ZHlPTGD6UdndGJicaLSEtxLvDqatMphTGFlL0ZbObUU8R386EEnxlNQJzZFdbB0XoQ4LPux5whye4CBQZkTCMeNUnzBD2+WISjMZ0DfUGCha00cBh2H66cq/uAHNF5o5ZdxMrKB1lgAKk1ojrAvXMBYw4CCDiJzybujDVrBmYTQCn34jqAaeb0ImKT/AeBXhp2s0ADw45U4U/e+MySpCunexKyaRZIRHuS9YcvL7N0+MCGKKfcmcsPK2fHy/OK6JhAiOCrg0G2xaV07P40vZBpjAkabm9h4tI7GwNjTcliljnXvOMXrIe0rI26qkSbyHSvTrwTwnZlaZc/NwgkENNfMHV2fo7UBdTHtzxh5olC8thQon4/erALYV9mNjPrt1NoRjN7R7cz0jRTRr9tjdLduwS3d2ukMAY4BfiCu56kGZSZ0cdqSz6G0lP60lsDw0AtmoQkPFGD9AUosEgPaszFp9m2+O1aAs9LADZQT8PlzbRUGEuDsic5hWh4f8/Kmg21RFOQFX1Om5RMI6tcKM4y5s55Gsc2a8dx3SO4JqffeHk7kQ4cDWPqoxLxSXYBWAE7klGmowGV/2DLZkRm71phxaw5Oj4fRHa+x8qLp0vBu/XEYcv6Em+RSmlUoYoaTWJOMvHOsXzBOsiRSA87xQVg23K5H9Z5Q9t9ZbX/En1EB8jm/7VGThRoQTCcwhqXUjyVccB/qXY4LTYcqmkXmzRYSfmdar3rBvKJJW22IuYPAxCfbal2xSLPdwjUMcJOYPQAmC5fZDQ2ekPmsdB7QZhHsNB/LqWzXxWmLgfTx65ai0mke8DDgNldkoF4U5R83Njy62VdjmmrbrhDDIebgu8EVVk2lAUjjOUKMnKVjvEB2nJhFziUbK/jEExqJvfpK8x4/4n1Cf3Nf9h9UESyArqVKkW27mCxx/wp4Ad 6cmWATwE GUJXBBsovTljX+PGZ+dEAI7Osi2+Nz7EqPCo0gWZXu1amsunOAzq4LzM7a5r9hKkNTNCFVR+jFpAgFtiSm9qebPIs3zKLgzx6FPdQ1S1Ct6YGEK/8hy/NbdQNHktGJDHYBtPE8X1eSyHgIv8EIapu4eqnlHWVI0KS5E9NTLOoLO+BH+Mp4hKXdP1TJhwYaCRZ5vGzy+KKL3Drg/P1AJV264+p5F1CF7pWj/kErkwnLP89WhBE0YHKlEVbRGBSlB6h8maEv9rM9CHLlcikbZ5T5nSuYKcmMP5sKQdT 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: Update the test-purpose DAMON sysfs control Python module to support DAMOS apply interval. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/_damon_sysfs.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/selftests/damon/_damon_sysfs.py index a75244451684..d23d7398a27a 100644 --- a/tools/testing/selftests/damon/_damon_sysfs.py +++ b/tools/testing/selftests/damon/_damon_sysfs.py @@ -114,6 +114,7 @@ class Damos: action = None access_pattern = None quota = None + apply_interval_us = None # todo: Support watermarks, stats, tried_regions idx = None context = None @@ -121,12 +122,13 @@ class Damos: stats = None def __init__(self, action='stat', access_pattern=DamosAccessPattern(), - quota=DamosQuota()): + quota=DamosQuota(), apply_interval_us=0): self.action = action self.access_pattern = access_pattern self.access_pattern.scheme = self self.quota = quota self.quota.scheme = self + self.apply_interval_us = apply_interval_us def sysfs_dir(self): return os.path.join( @@ -139,6 +141,11 @@ class Damos: err = self.access_pattern.stage() if err != None: return err + err = write_file(os.path.join(self.sysfs_dir(), 'apply_interval_us'), + '%d' % self.apply_interval_us) + if err != None: + return err + err = self.quota.stage() if err != None: return err