From patchwork Thu Nov 30 02:36:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13473983 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 1602EC4167B for ; Thu, 30 Nov 2023 02:37:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 41D9B6B03FB; Wed, 29 Nov 2023 21:37:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3CC246B0410; Wed, 29 Nov 2023 21:37:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2469E6B0411; Wed, 29 Nov 2023 21:37:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 10B156B03FB for ; Wed, 29 Nov 2023 21:37:09 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id E3F021206DD for ; Thu, 30 Nov 2023 02:37:08 +0000 (UTC) X-FDA: 81513058536.04.616B538 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf12.hostedemail.com (Postfix) with ESMTP id 1D5B140009 for ; Thu, 30 Nov 2023 02:37:06 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=dvVUGnsU; spf=pass (imf12.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701311827; 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=S7OvprRVzCQVTy9nlCCqrmLv57KjBqPf/71FHcnZ2wQ=; b=3hj9eGY3TQpoJ6IlveyNt6mU0NoZrqqWfhsHzLARXFDAX37IUufi3HCWczW8CANDKrDig/ Y6ZfCRKuFSV5ZQGp+vSe0d0AnzurKg4nG7ElYzY8zPHN+L0Nt984trLkDmmH2mbUQh58uz D+bPKhZcMvHpCBjLKx+4CninN/qwCkM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701311827; a=rsa-sha256; cv=none; b=uc3LFyVDTSBFvIK6kVQ1QCcQqZw9JtydLpghKcsIasDkVhqvUB5jFMv/Vpx8Blhsr60lbR 6fFmVMhQJ6eb/O91fVHseJMk1DR00kJJGtY00lJIy+pNqmMb3HWCgwb3kQgRXQ/2qT1AX3 MOb6OtTzS4V0LIyc97n8RASEi1xHa+A= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=dvVUGnsU; spf=pass (imf12.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id BDB5DB84147; Thu, 30 Nov 2023 02:37:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEC48C43397; Thu, 30 Nov 2023 02:37:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701311825; bh=hrTz5NA/0bpRG+IM7KT93kpboj36cTnKZu8N5QKEqUA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dvVUGnsUsiWCKqpDlmOX2XKk6UqdaHKsZaVRWF91tLjhwdxfdUtr9Yomb5BxOaIqJ FBXVuQfdLlmiSoWtD+ymomcu7SR+EVWV5O37jMU2y3G9C7TwprdJZb2uRZ0h/dLDVt pEkCA+vn2BnVIMRYYOiCLX46TP/NmsVyzhueBhNVLK2Y3iiLwzsiY2sS+RJ8AVbAkW l9gL7SBopuNkfmne+dJdUmCFE4I/1ZjVxk+CNKdEzM0fdaEU2Pnyz2z7t1263Ab6LJ IhBMQSbOi7qkVCFuIAe7E5otrcTrE5vJM6ctuRQXsR+QSb9ASNSWzaooKDvNJ7m8Dy mXxIO/shZsVIA== 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 9/9] Docs/admin-guide/mm/damon/usage: document for quota goals Date: Thu, 30 Nov 2023 02:36:52 +0000 Message-Id: <20231130023652.50284-10-sj@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231130023652.50284-1-sj@kernel.org> References: <20231130023652.50284-1-sj@kernel.org> MIME-Version: 1.0 X-Stat-Signature: qnbt4p5h3rbsa84ua9gzwkm9kfyqzaaf X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 1D5B140009 X-Rspam-User: X-HE-Tag: 1701311826-640354 X-HE-Meta: U2FsdGVkX18hP2pzL3ipZlPqTi1yal2HXmUHF2MQM4pe3ktKyoCjMFHQLvoQz59oboEASMI+JqQ8etLzFQ8pRpJDrKj5adIRRegRmsCqzd8dUY5iobJb0k7hJyesDOUPHEbTsT7YwiMJU4GU5o4+CNvKXchLYsBP+hBeGXFUd3JLyoGpK7hvKJk9bwgA99KAWdm2AuFxfKRUeOmoAmVMAzu2KVS3Cx8ttWQCT9yA12jk3DVDGtWb/g2rwFA/iPpG8ZBAnoj16EiV5voqNFKvrO2NO1dkbm721T4VWB9MwRZD/yAJDorqvGsxkXN65WXdxaCjsqm+y1nBPS+xY38KbFOTzCsiWGzX/O6VUnd/W+niYBwBeZoqtiHuzXFVAP8V0Rc+Zz+uztnTlB67vz4QND/kLDZWQy5n5FA6NhXKqgsmorB8DUCraL8r8WchJEYXuDOXhhC94+jQoqu1mcfvkfQbx9p5a/LYvhBz9Ci74WKx5sdbvg4ACJOxfnTv2lBH76Sgi4UM13f4a/34aF7i8nF3quGVHgE4hoKzNAAxreCEBZieifV4LIuHGj2aJ6Dfeo/k2XnwLvjrzYc+GaAE8gDPDCr1LbG1o0A6Td0IPU+FVpjuWpUqiD0ti1elcO5pwy0DDosJTw55iFRXFlYAz8gDxQ2z8Iq4VCKQiUzTIzoLmlIdMOutzX7quGoVQyvP/dqpmt56sITwo/O2efoJH4AaVGrnWmBWsknuvg3rrMt0/mwjbC4w6P7LgWXt5G9pS1K4OhTBhdEGBamX2grFRLZuGkhxF4HGUcaVLji9OSRAcDZS21AkalklgDw77pzwEII9xZhIYiE3qMVlEhZiImfV+o5Gqf3qjVJsCimqXNqxc/OzHEU0SJkgEbVymdz1+9uEHynd1wXrrQtVOBp4pd/RSt65WvAAd3MJ072S5TLK+DuJWv0UUrxQVHBWRWNSEMaEHeRZLJuiCaf42dj 3k3nycJP MPU37zh7DhXmRaD2MXuAxMoiGY6EgPS4fuEr18hThmqoKLETG0vL+V1QLAuaRS3O8m01e7OINk2dCkFlaf5eNy0OETkF8T9ZYccZPbgkeRtD+p0jXM0blNKHvniqCCGAe9EA3c5nDQQvYCdy1JLS8pQ5301fSwjRFraihLg5SFPkY2UkLKUlhpoz2Er/ZjYiPvI00lpdL8xna7OXlXWMbQTY94IysVhbi9x9tjkQv2dLwhfEloJBydKL3MDL0IDnEvLYe1G15F+ptpcGPDAu/IuCp+1owwC0yVpny 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: Update DAMON sysfs usage for newly added DAMOS quota goals interface. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 48 +++++++++++++++++--- Documentation/mm/damon/design.rst | 2 + 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index da94feb97ed1..ff9f62e65722 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -83,6 +83,8 @@ comma (","). :: │ │ │ │ │ │ │ │ age/min,max │ │ │ │ │ │ │ quotas/ms,bytes,reset_interval_ms │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil + │ │ │ │ │ │ │ │ goals/nr_goals + │ │ │ │ │ │ │ │ │ 0/target_value,current_value │ │ │ │ │ │ │ watermarks/metric,interval_us,high,mid,low │ │ │ │ │ │ │ filters/nr_filters │ │ │ │ │ │ │ │ 0/type,matching,memcg_id @@ -113,6 +115,8 @@ details) exists. In the beginning, this directory has only one file, child directories named ``0`` to ``N-1``. Each directory represents each kdamond. +.. _sysfs_kdamond: + kdamonds// ------------- @@ -121,11 +125,18 @@ In each kdamond directory, two files (``state`` and ``pid``) and one directory Reading ``state`` returns ``on`` if the kdamond is currently running, or ``off`` if it is not running. Writing ``on`` or ``off`` makes the kdamond be -in the state. Writing ``commit`` to the ``state`` file makes kdamond reads the +in the state. + +Writing ``commit`` to the ``state`` file makes kdamond reads the user inputs in the sysfs files except ``state`` file again. Writing -``update_schemes_stats`` to ``state`` file updates the contents of stats files -for each DAMON-based operation scheme of the kdamond. For details of the -stats, please refer to :ref:`stats section `. +``commit_schemes_quota_goals`` to the ``state`` file makes kdamond reads the +DAMON-based operation schemes' :ref:`quota goals ` +of the kdamond. + +Writing ``update_schemes_stats`` to ``state`` file updates the +contents of stats files for each DAMON-based operation scheme of the kdamond. +For details of the stats, please refer to :ref:`stats section +`. Writing ``update_schemes_tried_regions`` to ``state`` file updates the DAMON-based operation scheme action tried regions directory for each @@ -319,8 +330,7 @@ The directory for the :ref:`quotas ` of the given DAMON-based operation scheme. Under ``quotas`` directory, three files (``ms``, ``bytes``, -``reset_interval_ms``) and one directory (``weights``) having three files -(``sz_permil``, ``nr_accesses_permil``, and ``age_permil``) in it exist. +``reset_interval_ms``) and two directores (``weights`` and ``goals``) exist. You can set the ``time quota`` in milliseconds, ``size quota`` in bytes, and ``reset interval`` in milliseconds by writing the values to the three files, @@ -330,11 +340,35 @@ apply the action to only up to ``bytes`` bytes of memory regions within the ``reset_interval_ms``. Setting both ``ms`` and ``bytes`` zero disables the quota limits. -You can also set the :ref:`prioritization weights +Under ``weights`` directory, three files (``sz_permil``, +``nr_accesses_permil``, and ``age_permil``) exist. +You can set the :ref:`prioritization weights ` for size, access frequency, and age in per-thousand unit by writing the values to the three files under the ``weights`` directory. +.. _sysfs_schemes_quota_goals: + +schemes//quotas/goals/ +------------------------- + +The directory for the :ref:`automatic quota tuning goals +` of the given DAMON-based operation +scheme. + +In the beginning, this directory has only one file, ``nr_goals``. Writing a +number (``N``) to the file creates the number of child directories named ``0`` +to ``N-1``. Each directory represents each goal and current achievement. +Among the multiple feedback, the best one is used. + +Each goal directory contains two files, namely ``target_value`` and +``current_value``. Users can set and get any number to those files to set the +feedback. User space main workload's latency or throughput, system metrics +like free memory ratio or memory pressure stall time (PSI) could be example +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. + schemes//watermarks/ ----------------------- diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index 947c9df6cd33..8b4a49ac057d 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -346,6 +346,8 @@ the weight will be respected are up to the underlying prioritization mechanism implementation. +.. _damon_design_damos_quotas_auto_tuning: + Aim-oriented Feedback-driven Auto-tuning ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^