From nobody Sun Dec 28 02:41:49 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5C87C4332F for ; Wed, 13 Dec 2023 19:04:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235487AbjLMTDz (ORCPT ); Wed, 13 Dec 2023 14:03:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233811AbjLMTDu (ORCPT ); Wed, 13 Dec 2023 14:03:50 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB756B0 for ; Wed, 13 Dec 2023 11:03:53 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBF17C433CB; Wed, 13 Dec 2023 19:03:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702494233; bh=KJAl103OAFoAr+UeUtJKB48jbALa8Ynn0eVxO6I87hY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F4ZYtp9e6u1S7vJVoTQuManLwGlrjOeID7BQLcnqFPRmQJPlm0o42k6kIz6uqAfU+ /HE5a9iWB/nCg4QL7ho2iGnYV78Rzv91bOo4uwfG8hwgqoniBuN+bYKp600U99SX/2 z4TYpYXhvBqmr2HXUHooXJ56cx0BIyv65XrswEfh3fot7+WOrwj6Dh0fGrxS/qXJ0d MwDbUOg8Llty3aCoY3Nb/Jb2XinjBJdNkkEJeB7L5Oujli7nQ2ACJPkBYBdVMKlALB XDyzklyW5EI8kshSqnJnQ21yO5J4ZdyD+hN/+Ljd+y7ttdyvcWB2x/pINClxdh92EA KiEA+aTGWd87A== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/6] Docs/admin-guide/mm/damon/usage: add links to sysfs files hierarchy Date: Wed, 13 Dec 2023 19:03:37 +0000 Message-Id: <20231213190338.54146-6-sj@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213190338.54146-1-sj@kernel.org> References: <20231213190338.54146-1-sj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'Sysfs Files Hierarchy' section of DAMON usage document shows whole picture of the interface. Then sections for detailed explanation of the files follow. Due to the amount of the files, navigating between the whole picture and the section for specific files sometimes require no subtle amount of scrolling. Add links from the whole picture to the dedicated sections for making the navigation easier. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 70 ++++++++++++++------ 1 file changed, 49 insertions(+), 21 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/a= dmin-guide/mm/damon/usage.rst index d3514367703b..671d3e50b998 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -59,43 +59,47 @@ Files Hierarchy The files hierarchy of DAMON sysfs interface is shown below. In the below figure, parents-children relations are represented with indentations, each directory is having ``/`` suffix, and files in each directory are separate= d by -comma (","). :: - - /sys/kernel/mm/damon/admin - =E2=94=82 kdamonds/nr_kdamonds - =E2=94=82 =E2=94=82 0/state,pid - =E2=94=82 =E2=94=82 =E2=94=82 contexts/nr_contexts - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 0/avail_operations,operations - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 monitoring_attrs/ +comma (","). + +.. parsed-literal:: + + :ref:`/sys/kernel/mm/damon `/admin + =E2=94=82 :ref:`kdamonds `/nr_kdamonds + =E2=94=82 =E2=94=82 :ref:`0 `/state,pid + =E2=94=82 =E2=94=82 =E2=94=82 :ref:`contexts `/nr_cont= exts + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 :ref:`0 `/avail= _operations,operations + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 :ref:`monitoring_att= rs `/ =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 intervals/= sample_us,aggr_us,update_us =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 nr_regions= /min,max - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 targets/nr_targets - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 0/pid_targ= et - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = regions/nr_regions - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 0/start,end + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 :ref:`targets `/nr_targets + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 :ref:`0 `/pid_target + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = :ref:`regions `/nr_regions + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 :ref:`0 `/start,end =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 ... =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 ... - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 schemes/nr_schemes - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 0/action,a= pply_interval_us - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = access_pattern/ + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 :ref:`schemes `/nr_schemes + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 :ref:`0 `/action,apply_interval_us + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = :ref:`access_pattern `/ =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 sz/min,max =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 nr_accesses/min,max =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 age/min,max - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = quotas/ms,bytes,reset_interval_ms + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = :ref:`quotas `/ms,bytes,reset_interval_ms =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 weights/sz_permil,nr_accesses_permil,age_permil - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 goals/nr_goals + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 :ref:`goals `/nr_goals =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 =E2=94=82 0/target_value,current_value - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = watermarks/metric,interval_us,high,mid,low - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = filters/nr_filters + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = :ref:`watermarks `/metric,interval_us,high,mid,low + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = :ref:`filters `/nr_filters =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 0/type,matching,memcg_id - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = stats/nr_tried,sz_tried,nr_applied,sz_applied,qt_exceeds - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = tried_regions/total_bytes + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = :ref:`stats `/nr_tried,sz_tried,nr_applied,sz_applied,= qt_exceeds + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = :ref:`tried_regions `/total_bytes =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 0/start,end,nr_accesses,age =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 ... =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 ... =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 ... =E2=94=82 =E2=94=82 ... =20 +.. _sysfs_root: + Root ---- =20 @@ -104,6 +108,8 @@ has one directory named ``admin``. The directory conta= ins the files for privileged user space programs' control of DAMON. User space tools or dae= mons having the root permission could use this directory. =20 +.. _sysfs_kdamonds: + kdamonds/ --------- =20 @@ -154,6 +160,8 @@ If the state is ``on``, reading ``pid`` shows the pid o= f the kdamond thread. ``contexts`` directory contains files for controlling the monitoring conte= xts that this kdamond will execute. =20 +.. _sysfs_contexts: + kdamonds//contexts/ ---------------------- =20 @@ -214,6 +222,8 @@ 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`). =20 +.. _sysfs_targets: + contexts//targets/ --------------------- =20 @@ -221,6 +231,8 @@ In the beginning, this directory has only one file, ``n= r_targets``. Writing a number (``N``) to the file creates the number of child directories named `= `0`` to ``N-1``. Each directory represents each monitoring target. =20 +.. _sysfs_target: + targets// ------------ =20 @@ -255,6 +267,8 @@ In the beginning, this directory has only one file, ``n= r_regions``. Writing a number (``N``) to the file creates the number of child directories named `= `0`` to ``N-1``. Each directory represents each initial monitoring target regi= on. =20 +.. _sysfs_region: + regions// ------------ =20 @@ -265,6 +279,8 @@ region by writing to and reading from the files, respec= tively. Each region should not overlap with others. ``end`` of directory ``N`` sh= ould be equal or smaller than ``start`` of directory ``N+1``. =20 +.. _sysfs_schemes: + contexts//schemes/ --------------------- =20 @@ -276,6 +292,8 @@ In the beginning, this directory has only one file, ``n= r_schemes``. Writing a number (``N``) to the file creates the number of child directories named `= `0`` to ``N-1``. Each directory represents each DAMON-based operation scheme. =20 +.. _sysfs_scheme: + schemes// ------------ =20 @@ -310,6 +328,8 @@ Note that support of each action depends on the running= DAMON operations set The ``apply_interval_us`` file is for setting and getting the scheme's :ref:`apply_interval ` in microseconds. =20 +.. _sysfs_access_pattern: + schemes//access_pattern/ --------------------------- =20 @@ -323,6 +343,8 @@ to and reading from the ``min`` and ``max`` files under= ``sz``, ``nr_accesses``, and ``age`` directories, respectively. Note that the ``m= in`` and the ``max`` form a closed interval. =20 +.. _sysfs_quotas: + schemes//quotas/ ------------------- =20 @@ -369,6 +391,8 @@ metrics for the values. Note that users should write ``commit_schemes_quota_goals`` to the ``state`` file of the :ref:`kdamond directory ` to pass the feedback to DAMON. =20 +.. _sysfs_watermarks: + schemes//watermarks/ ----------------------- =20 @@ -388,6 +412,8 @@ as below. =20 The ``interval`` should written in microseconds unit. =20 +.. _sysfs_filters: + schemes//filters/ -------------------- =20 @@ -483,6 +509,8 @@ and query-like efficient data access monitoring results= retrievals. For the latter use case, in particular, users can set the ``action`` as ``stat`` a= nd set the ``access pattern`` as their interested pattern that they want to q= uery. =20 +.. _sysfs_schemes_tried_region: + tried_regions// ------------------ =20 --=20 2.34.1