From patchwork Mon Mar 3 22:17:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13999552 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 362A4C282CD for ; Mon, 3 Mar 2025 22:17:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3DBB8280008; Mon, 3 Mar 2025 17:17:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 364C1280001; Mon, 3 Mar 2025 17:17:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1DE72280008; Mon, 3 Mar 2025 17:17:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id ED2B5280001 for ; Mon, 3 Mar 2025 17:17:43 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id AC86AB6F45 for ; Mon, 3 Mar 2025 22:17:43 +0000 (UTC) X-FDA: 83181652806.06.63B487A Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf28.hostedemail.com (Postfix) with ESMTP id 0B6B2C0005 for ; Mon, 3 Mar 2025 22:17:41 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=bSqjdJHA; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf28.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=1741040262; a=rsa-sha256; cv=none; b=3mBev8K287OWv2BHSS1QkRhR0moeuDsxxwcicNFsG1dsPhvDqPk6dmtYbmImKNxnwy1A1c P4I+TSMJh31HG/3yIeIEoDAWiQm4hXFsGYT8vQ8VI+FLuGFD3g6F8ZRV4CDJfWsoLlO8w7 lDcghmbIe6UZVRXbDAtEgNkPqe0ttIE= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=bSqjdJHA; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf28.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=1741040262; 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=qrsAeFb7V7B14LyH2cSpmWanaLlO10JwOQH/6uEEzBo=; b=21guyw/uP3YJ1jsTn16L5lRJy8ysECRxKZp9PzkFGxQ/P5TnYthlC/PqGkqHMPIhe7Ygs6 vljP6MaIhN1gKyPgmTq1R3in98LO8zjFsKqJb5Yo5eg15s5Xk32MK0ZNUqvNFitpnv/LfO C5IxhILgynaklC7BEqLhMuAazB85h0I= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id EABAA5C49BD; Mon, 3 Mar 2025 22:15:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CD32C4CED6; Mon, 3 Mar 2025 22:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741040261; bh=ki10B3zR5mixA9j/A7CWQx5SObRymhGEPj5DgsDuWCo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bSqjdJHAWbCdKV26S5QgEbhmE/6LeicMKJ+wZON2b3jtP32CDTJN8OUy8U8OY7syH u64jhcgK91le676PO9VA6Vmk32Jv73Zy0spDofUVWFUwh2KV8KoZboLwh4F6Y6sG/X QwDCblpotBaH8hZrUKCgm2GFZ44sTsxbteMzd0GqOgDDRQ/oGMOA3PQIqpNybb8FBs ByTkVeW2FI03SCLnn4RHpRyQWXT0Gb0iJVGQgzf83PjqR72I2Xenb45FltOLWcHJ72 E8/IRa4wDv4/hKWWK4PC9qEBkIo41NxYaGiEmj/Os9LLrGNPdmIMzh8+RXyjPPnf8e jpAtHzLHxn7Rg== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , 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: [PATCH 8/8] Docs/admin-guide/mm/damon/usage: add intervals_goal directory on the hierarchy Date: Mon, 3 Mar 2025 14:17:26 -0800 Message-Id: <20250303221726.484227-9-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250303221726.484227-1-sj@kernel.org> References: <20250303221726.484227-1-sj@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 0B6B2C0005 X-Stat-Signature: wz1ypf5pzbkfkohwmeoty9npbte9m81e X-HE-Tag: 1741040261-6458 X-HE-Meta: U2FsdGVkX1+4Yldo3oPCWeqaA4LwA17r/eBT9qhz06Nto8oVnLqSyux7ZuC/KF9+Mhz6JP68F/oykYBM6TTslUJ/I/hDO/JlcMSGGqJkaM/81m60wHHolxo50gzQUb0xKQyFXBFRA5RdCqT31LCejiDuHBGwlaSmoaqDkaY4i6TNGK0gjx1NjM3zQGLBTHeFIT4EDL0y95QaIpydRBldy8lRPPTVVXEAyxUkeXFwETZatsaEdmDzzd5X4x2hJieCydlCzk+uh5E65CKVu9ZAFS3OOf3EqvFFSW83e2fYaNj6Qbh9MjU69zSQn14b94p+isuqKiOeJYg2MQ/7MT3mg7xFjSIe7DcyTCY3SMPd4ADeqqyihOA2jR/yygl6BQSfJQlb88uKP1ZiyH/+CiV9NVsxoDT7LThlRfZfTQs3KrhokaIi92rwugX4M6WtcX125IoWLv6QDFH6mrjcpItL8H+pTI/8YWpXauu66vCXPr+klboZ5Qv+z37oKdGmxMYcRCLjg8LVMYAQiVHlECIv3tyhpYTMdZhbvr9MTvNvbRkIdf64RWmxfkefT+/j9PrE8ulhlC35tFKriYN52jQ31exbuahJbaW1TALPffSnYMAy40DzIZJPbBd+vsfxHAt1AWQxr3OamhWrj7K3BL2MGyr1kvcoup+vChKycChbqrrtTlIWv4uPO0MRq46rz0ttNnAQzeAm80X8u3JHKz+7mV89SqjtTQbHVMUj3uRUabIqJnSo5MsEdK5bNwu9kIZf1YWaBXeOWGrIUMk9Mg4/1NMXTtYh+l3TDsXzwX6aY+wqUmOidOAL50ybebcCudSl7CGb6Bln6i1cVZ7KP+MTrZ9clWpokj13bjPEAZ65lVw+LNUXbw97ZJbzMrqb29Gp7pCxfpq6DJcVMdgXvr4oAv/wLF7nowWY/Xdqpif3zhO5Ykyb1GuwSprJDM8b8gnlihUdeY1jmtWAPcNbkWf yyleXSOH jc7rudQR3cAw2Z2cyZ2hV9rU1CZaSvO1rSQD/4APMb+s/RBXO1JTaQ62e5dT1WGk46ZzbDWp5n3N/jPNrsDWi21NvBZTkXDFc7MPjV7HFwWTuU7836IJjraOa2cmH8pckT7FV1UhPopleNA4voPzoGbUOVCrWtRoIOF76+BuAnEiXKDFmAC6/K0PKlHbtMPyeFvgN7tfsOFry2tBQrEf29rw3Lrh87i6Cn5uhTwRu40H6oJPzcbp8abSPZLpXfUP99F/ueOiI65LAHb/GwevgL79Jr6YOvaY3c5/VuaIfqoQFZQnsBrPigs00+UA2u+psKHBz 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 dc37bba96273..de549dd18107 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 cb388d791ff7..26c9ab10daf7 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: