From patchwork Thu Feb 13 01:44:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13972688 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 1301DC02198 for ; Thu, 13 Feb 2025 01:45:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DF9F26B009D; Wed, 12 Feb 2025 20:45:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DA92A6B009E; Wed, 12 Feb 2025 20:45:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C25106B009F; Wed, 12 Feb 2025 20:45:04 -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 A3D616B009D for ; Wed, 12 Feb 2025 20:45:04 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6783DB233D for ; Thu, 13 Feb 2025 01:45:04 +0000 (UTC) X-FDA: 83113228128.25.F220163 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf15.hostedemail.com (Postfix) with ESMTP id AD44CA000C for ; Thu, 13 Feb 2025 01:45:02 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mSX6aGIZ; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf15.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=1739411102; a=rsa-sha256; cv=none; b=IUBTOJKPeXV0/o/OqdzT5n8XoTK7uZCp40+AKALP7R/R5QtbOt9YY33KH/yOM5Vtrr5Xsy 0cUM8aYFmBJkkU+peUvWkEzBxwMzUCu2mEQ4IB6NN2ltk6SCDg1H1+yfZ9cwTCghw8sSwg cNSbdi14m//Q0chk6NQg1fk1K17R1V0= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mSX6aGIZ; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf15.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=1739411102; 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=FmAySk/6wcB5/SPAIcowJvqz4yKMiS0+BrQ/P8OVA4Y=; b=GJyL/vHejTUbagzg0QCv1qjgMIRFivIlmPQ5n+tRSuammic3uRqvwQHMkrenhUurN2oB/g 5AnIySZXTrOY2Pm3NVlxDQMgAPeipzh++ZvqtzTZ28kQZ5yEPdonssjlplyojBoTLa4IfT Ri/12yTvjHmUiquK5FlO48xcybf/dC0= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 6E5875C6370; Thu, 13 Feb 2025 01:44:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95533C4CEE2; Thu, 13 Feb 2025 01:45:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1739411101; bh=QR2M3ggNynpLgjaV5MuEdSsLXcYuPIdLc3HO6YmtxuM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mSX6aGIZUvu8Ow3QiHi49WpJMlcbTPa3MmrNc3TMLwyrXGyAMkh+D08gbtBhrm5Ka 0FMbInTxW20qQKBtCs0qQ0HwHpXpDwt1M1VVj64fATFn13PR2u5Q3km+3EdSR2Wtgk D54xFRjVT5lBCDv3bu/wLFBl5hxvp48h8TYyVc/e1r7o5/gdGK480VsLuMq0QAdVdu EWYzQ9pl2FxlK3ErLMGQvJRSE24Vgr/oB70eF4/X+PzZtZz3D30HK8DrhmMCLhNbmw SESO8O1kjGGKQCKodHns7yOiLNSzCrnXF2IpRTySqpqw1xzps064C3NUcGzmBGNfnp A1jNF2i79DYXw== 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 8/8] Docs/admin-guide/mm/damon/usage: add intervals_goal directory on the hierarchy Date: Wed, 12 Feb 2025 17:44:38 -0800 Message-Id: <20250213014438.145611-9-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250213014438.145611-1-sj@kernel.org> References: <20250213014438.145611-1-sj@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: AD44CA000C X-Rspamd-Server: rspam12 X-Stat-Signature: yfk1jzym1bfd1e3i5yx7haxwzejjf6bw X-HE-Tag: 1739411102-248297 X-HE-Meta: U2FsdGVkX1/PCzoqP2/j/jSub7QDC3d4IexUY6onzfrfagZxYypAgO7TLSFvs4NNY4rcUjxvW+mp3mbbikPwVdrj95GJoeI5yV5gHq9TNWoaI3Lv8xwRbW5SR6SjniR0ZTfKfPLTBtXoZ70IGNEKwX4ogCEnfPYM99KNLW1BqVYZ/F95PIGVS5K1f8YRjIBw/XCDOc/xrBdWdrGBYLmoNBsnSoY6l1J1dL8OEhcItCbwboUimg8pnRmwuBCW4cjqs1JCBqcCpq0ZZVEgnIFFbpbQXzIYbdIPtOOR819k+kw/Qm1jDFwjMVy+bWwdBbbAqmPTNaVind9RqXqMXoDX8zmmK6h1OoTQ0fHbQyhCBJIjLvUdmjL/4VPn4S8a5S4Ew29Opryo4z06tdhCcFqSKnPS/yc0vptc/AFpFYip21uALmC9+L0FzqgfOhctZvllMi0KKbTyVDFcezmQ2kL1VebazPIRwHl15WSJT2LyMFZJDW30WPtA+paI859DZIgWb9YwmBR8Sn1TjFLSad/S2YtMa8//hiAP9gjhiIPa2fRXIhlpLEV+YfW6ZDMl8ifhNiGCoLtyqNy1wwnIcs42eY5V4+97WYMrdjkclFLslPFfHBuTCNqcn/3eC9Zovxjn/dO+TcK8r3cid3ehP/E7dxIRFW0tj30W51andwezn9S4RFIHY+gGFD7yDKgjcCmT1dX1cXhQYOdmBjZKtp/C3Wmp1kmK/mWk6VDV/xVjEiLbDItBzs1YRtPgeGFemMM3IyKouWxB0t6FDCkyta0YdMx2JTB6QWnzOs1Nqt8P3NC/cBll7MZgvB8Ql0yuFn80M4tKk2tL8OrLbvxXuyakGWpxg5fAV2ns5v5QL1U5CeOZn5zD8kJyrEbOINEyiZefaNC0rZU7CJ+LACCtfN5vKvTAXYCKHo2IJAfiqZa6KDnJT2RQBxQjNMf49pf0YjSmEWmnI4+95WrEHe95Tus MDzRolgd zqcKCf/ShdnKZs9k/JZj1ODAU2j+bmFvqQLhNJ2cu3qXf4JPq3XC0YTypuFNd3e/f+T7tyyeyCVK/46xltI9Qx7GnbID0OZMitUJzpFZITCJrDSO++TtjW1xR45/2oEipG6zQg46FaQvb68LJmSQpYH9T6TeIe96fzfyLPhzrL/qoA5Zzm9WHTkDyb2fjwmgzyHM0PgpoG2J459Hu6mRcHOK9wF4VfJ+dSzeF1k1Q6pqPfN14npOHFG+aMMUHU8oZu9qyk+utljL13cTpMQI9373LcLld1ygE9WLoCtsc1OAFfXWIsDcry7y8WA== 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 51af66c208c5..8970efce32f0 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/samples_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 +``samples_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 c8e906ac3965..940409abc23f 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -354,6 +354,10 @@ The tuning is turned off by default, and need to be set explicitly by the user. As a rule of thumbs and the Parreto principle, 20% access samples ratio target is recommended. +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: