Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp553318rdh; Wed, 7 Feb 2024 12:32:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVnqrhBaNlZXHAZh4IXUT2UItp8BC1cBm22Tx3Cdf2RQvWeDQhX6F0aOfg6s/Vj4l0t5lnt4yPXzvQ+c8kHblex4JxXKXtNM/a+/jJ1pQ== X-Google-Smtp-Source: AGHT+IH69KVQkVZ4J+uLFLH+NLSJwXcicoHKzpsjyUp+C3Bou1ZNrtNHa4mko0eJ0TMUvs8SJAFe X-Received: by 2002:a05:620a:5b:b0:783:e086:5737 with SMTP id t27-20020a05620a005b00b00783e0865737mr6766451qkt.45.1707337938566; Wed, 07 Feb 2024 12:32:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707337938; cv=pass; d=google.com; s=arc-20160816; b=JJgwoy67CPlTVERAL3jISzRoLU/FMy6zGOovpEeRxB3PzT2sXXTKD8U/GDVTUIJTW7 cd/3dMnkOcglOyeShnA4xk+eQzdHDuvAAtBg+3bexjHgX21GI2i5dGtlP1bJUKSiMWRr 51plQ/E2PUOnHXiBZGoId83wh7YKgm0fUr1pU2O1DWs7WBf/sa9TNkMQY4E4NQy5Kz4i 97aNLMTgy27v/PRPo7jyeR3p5pnOPGQB2kNvdXE7HdV8WcutzCVHgYizmdCxpFSx2RXZ eSSA+VkozbE5AuYBdhg0pmoLc+WjEAaCdBwe1QFlyIXA5DkOWNoVx81rBO6FB66jj4Sl RXuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=lqk+XrNBIXzsY9QkTuWpsp4fsxkH9nn7jyu/kZayx0c=; fh=brQWD/KpDQi0BMZHtwBG23Z+p+keB0SsYa+MmWV+3OM=; b=jZr6+4u8MZaPymgXr83ybRcpEaw97pRRclaWxBqNttcNYsZNe/FSvGmAITFW/xoYKb O5aVKhFOJUKzGOkNdyCQp0zwUKvnkJiP5oztszwDWoYehOjCehnOCw3z+/Xr9EHoT9Xa zcvtRLj/1ppjHP42h+Y+S8Kw+o97gEivYbqV59BdpaE1UjMkj9Dj/i2v6E80ipY3pPIk Cf8+0MBnP6EKXEHSRfV0gtP8pFEEkNFb1eURoPBytv8SZj2cSX8mS8CoTOspI6d2csB8 vqG3g0Dk5TQvovUpy3GqUjey1u6ABWtgYJHpx8M1Npouvw1qYyLMNLcSfRE8r/NzQ9Jp 2QIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fi0iIujP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-57029-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57029-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCVWFhfR2AioHr+AsGoCPoJ/rEA06YgXzXMnmg4eW2mgBbtOWMYx8w64+VW93D6pQUoHnGesUOuVvFAMFv/KrZPq5M48weCXxqpN5BOdNQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id vv22-20020a05620a563600b007858af9a0a4si1865259qkn.199.2024.02.07.12.32.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 12:32:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57029-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Fi0iIujP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-57029-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57029-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 50AEE1C24A68 for ; Wed, 7 Feb 2024 20:32:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9302212882D; Wed, 7 Feb 2024 20:31:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Fi0iIujP" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACF48127B6A; Wed, 7 Feb 2024 20:31:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707337903; cv=none; b=ReMf41TxJt02g82c2JRvTso401EjwAhHDCMVEmqzBMv0pFNs/0pcIiVjTVRLUzySmPRr2IpQTtqX+y3SzQlGU0FGWmIPm7yd8D6UvBRRDmoTa+RGIl0iQYEYvTmN3n3o2+kfUa0xd4MYc30bbq/7+78CMaJ8fxFEgToz8UouPws= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707337903; c=relaxed/simple; bh=9lLmi3bov7hQSKSz6Wm19r7FnAY+g94q4B/k/Jgsk9k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZFGEBVLFnu2VjfV2vR7xw8Js9krah8gzCdvnU/21bDhhF6bgdNT7FZHAVAjSVrcmUXyFg/abJ8M+otrhYKH7U5DSgq+lrXUqIV7qIrrdNZQFFVFhjKrH5mnF/rQAwg08RpS6cdFhoZC+J7/cPuyw+MBG6YCq5l/0Z1UQ3TTiErU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Fi0iIujP; arc=none smtp.client-ip=10.30.226.201 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 -- 2.39.2