From patchwork Fri Feb 28 22:03:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13997213 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 9DA00C282C5 for ; Fri, 28 Feb 2025 22:03:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E01E928000A; Fri, 28 Feb 2025 17:03:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D8ECC280001; Fri, 28 Feb 2025 17:03:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C2A8228000A; Fri, 28 Feb 2025 17:03:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id A25AF280001 for ; Fri, 28 Feb 2025 17:03:46 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5F10F51049 for ; Fri, 28 Feb 2025 22:03:46 +0000 (UTC) X-FDA: 83170731252.29.E07966C Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf12.hostedemail.com (Postfix) with ESMTP id 9B9CE4001E for ; Fri, 28 Feb 2025 22:03:44 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Nq2iiPk2; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf12.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1740780224; a=rsa-sha256; cv=none; b=f8rU0/l+WSRIxQt5EsxhhXOFQoTI+No6bTqbcjgnPpipcvisobA0pBIgSpSWsiboXBa5I5 CJVAwQTWcN/iqQSGIaEhUOrnpPos87TWyadVYCsGHg//WDj2eCQg8yIlE3gQAAGzlVBScL LMzZfVTvTRcWI5s05JB/H7zkm0Aui0M= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Nq2iiPk2; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf12.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1740780224; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=bVg1UWRq+jplojKVJsv8iNMp7YxxSUDLbXksMkp4XAA=; b=oMarS0hozQB5IT9vrfhvd5ofpnZz64BkL0vTYq5xNdLiq8LNEO93S1NDqTR/GFx8mvC+cV zW6cdKVlZQJkRCMzVLUQ8CXSnLoQNUN/niEDtTKnrzSAwxXcraLXTS7vGEzzkqUhpMFIpz 4J5g3l1Mld8KfQmcyZP/knu5l9EeFxY= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 0B25D5C6542; Fri, 28 Feb 2025 22:01:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8453CC4CED6; Fri, 28 Feb 2025 22:03:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740780223; bh=/MYVJ3rlbtoAJvOWV+07+WHhI+Q9ZMyJiRshemc3Pdc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nq2iiPk2X5wTDN1rEOhOJnEv7NUqTZJOvlOPuG4MMW8vwgYUrCmBJZr0xIR1yo67p d62wq7xVOamZeT/26kiOHlRTUgVUh+AKnoUpbQvikp9/ocZxHLXyjbkLd3hq84CNsr itckDfPhKA/XUHOR/oCEIecXteOvOtfPEAVZ+dJlAW9cT0J9Otlla234ZkzQuJFEyR ICpB0TrNmaOreR88REGBcrAGzRMAo5KqlM4PuuNKBWE2GJES9v5cdNsU8Op9pvsHTT xy80Iro2FNyawVskSDN6LLFepAILtO1ZerHnL5MBoetcI+LH4E19VwtbKEPXLQDT/s FgfKKuVTQLcTQ== From: SeongJae Park To: Cc: SeongJae Park , Andrew Morton , Jonathan Corbet , damon@lists.linux.dev, kernel-team@meta.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH v2 8/8] Docs/admin-guide/mm/damon/usage: add intervals_goal directory on the hierarchy Date: Fri, 28 Feb 2025 14:03:28 -0800 Message-Id: <20250228220328.49438-9-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250228220328.49438-1-sj@kernel.org> References: <20250228220328.49438-1-sj@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 9B9CE4001E X-Stat-Signature: ttin64b8bs6uzgrffro6qq173dc1ozfn X-HE-Tag: 1740780224-467700 X-HE-Meta: U2FsdGVkX1+vedoJAqnTAOsWjCn6vlXJ55uEZ9Bw7iRVNUWHyjUk6DW28KRScNfNZiC2onyAgy7lMN2LChdWhcyAQ2OVaKd0rpr+T27To9kWR4Hbp33o1WpwA9O2uiiP5ywe6k+TUfZdUpLsiALOPC5cWRcQ8YjPzTPTuLmqCrpNOWYixr1dMT0hobnJQl7HKW3yXCd1gSOZhEGBEghYA2ZJjnTAeXOaHTlDfnIwCYz9JsOFg8nKIiyLsN+eatcmGLaqPE2mknMM31JrQvlQ7dvI3IciSD9S1YixRD2aaOKcoIXq0GHAVt52v4LyLJNDtyzYURxFkmFHQ0qevTrfoWPnR/EaSvsfRBJCwU33Ebs5UdCV0h9YKyV6tIQXeJV87qknhptjp7/X6gh0BjjApYuV/2jCLALzRG8LM8QCt/2c2UiLUZandJPB+qwSjrLHuaHpi1OhLibkzX4jtf4/7ZUDYndMsUXCmxmY9/cLm+GGOD9NY1y+K3R+/KzhX/B7kYCTlnJzvdsQIHaq8KJjAFiJudbSzaZMbDQFc9UNCxSTdBwW6jawmh4x83PJhmOYYilWvir1zt9aLmBetNmArRcIfipr2FkmSmIV4N8xLXyh+UStI9/NcjlcFTVV8acKFKMlc6KnW3IWxLVkxLFWRHHWxxUUuEtG0biF4l9NtmcSz82KVWvVSyKbof2YTlkaCKzK7Mb2/GAY7zzsrh3zDFVvc4hK0jEMRgKYVJW6jTFKj1UlgK8Yd6mQgl6OaL2PCnh4TsHpjaYoBQmyt1ewtKVlCT2HRG+62NP8k9aT7U+Q7c6gRtPwtnazyP3PPv3966FC35SfXi3mRegj5v2wlJso6BxAeHpQf+w0RfQoutD5nDhIBwrsFWct8LoILSqYucgmbLsgXPTpe0O3S6Jjf93qX5dMHlo7q33V2i3DkBFEEUqw4nPn31tqByBV+4ZbXa5D32py9ZDvXzgFZAr KYncRgGh fYrduuCS/ooeIctDzeJH3rIcVBI9a1YYspdE7RAsF+N3GOXtaZPXTWYJPGCvX+gcQOGJpwjr6o5bQXKdMubcLwZ9Ybx/Wci5KlU/IjXeisXAMlr/n2eC4WC4J+wRDiyR53tBst/crlnGX3MgaLJ1y5wRFuOTbrppLUzIx2LS9ejV6luHMQMaY08go29wXnIDL+TFnc9EdeawcAX5SlMf9ja/M1MxqdoJUo1kAJrPpxPrS2039zNrCyCBZeOk8zbmfEpdYzioVHm/ioP8sNTJZICHQ0jL5haNjjAmHWsCx0Oudns9QVQeYbNWlvA== 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: Document DAMON sysfs interface usage for DAMON sampling and aggregation intervals auto-tuning. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 25 ++++++++++++++++++++ Documentation/mm/damon/design.rst | 4 ++++ 2 files changed, 29 insertions(+) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index 4b25c25d4f4f..8f01ad8792e7 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -64,6 +64,7 @@ comma (","). │ │ │ │ :ref:`0 `/avail_operations,operations │ │ │ │ │ :ref:`monitoring_attrs `/ │ │ │ │ │ │ intervals/sample_us,aggr_us,update_us + │ │ │ │ │ │ │ intervals_goal/access_bp,aggrs,min_sample_us,max_sample_us │ │ │ │ │ │ nr_regions/min,max │ │ │ │ │ :ref:`targets `/nr_targets │ │ │ │ │ │ :ref:`0 `/pid_target @@ -132,6 +133,11 @@ Users can write below commands for the kdamond to the ``state`` file. - ``off``: Stop running. - ``commit``: Read the user inputs in the sysfs files except ``state`` file again. +- ``update_tuned_intervals``: Update the contents of ``sample_us`` and + ``aggr_us`` files of the kdamond with the auto-tuning applied ``sampling + interval`` and ``aggregation interval`` for the files. Please refer to + :ref:`intervals_goal section ` + for more details. - ``commit_schemes_quota_goals``: Read the DAMON-based operation schemes' :ref:`quota goals `. - ``update_schemes_stats``: Update the contents of stats files for each @@ -213,6 +219,25 @@ writing to and rading from the files. For more details about the intervals and monitoring regions range, please refer to the Design document (:doc:`/mm/damon/design`). +.. _damon_usage_sysfs_monitoring_intervals_goal: + +contexts//monitoring_attrs/intervals/intervals_goal/ +------------------------------------------------------- + +Under the ``intervals`` directory, one directory for automated tuning of +``sample_us`` and ``aggr_us``, namely ``intervals_goal`` directory also exists. +Under the directory, four files for the auto-tuning control, namely +``access_bp``, ``aggrs``, ``min_sample_us`` and ``max_sample_us`` exist. +Please refer to the :ref:`design document of the feature +` for the internal of the tuning +mechanism. Reading and writing the four files under ``intervals_goal`` +directory shows and updates the tuning parameters that described in the +:ref:design doc ` with the same +names. The tuning starts with the user-set ``sample_us`` and ``aggr_us``. The +tuning-applied current values of the two intervals can be read from the +``sample_us`` and ``aggr_us`` files after writing ``update_tuned_intervals`` to +the ``state`` file. + .. _sysfs_targets: contexts//targets/ diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index 0cc9f6441354..0cf678d98b1b 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -366,6 +366,10 @@ is recommended. Note that Parreto principle (80/20 rule) has applied twice. That is, assumes 4% (20% of 20%) DAMON-observed access events ratio (source) to capture 64% (80% multipled by 80%) real access events (outcomes). +To know how user-space can use this feature via :ref:`DAMON sysfs interface +`, refer to :ref:`intervals_goal ` part of +the documentation. + .. _damon_design_damos: