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: 171700 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp113858vqy; Wed, 29 Nov 2023 18:38:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/y7m1mEUkrTfXPB+wR5XC3671DZgCw7hzwqsO7Z7MaMD8+919BbxtWVplp2Ek+k5Xc4aM X-Received: by 2002:a05:6a00:1142:b0:6cb:901a:874d with SMTP id b2-20020a056a00114200b006cb901a874dmr24110846pfm.10.1701311913237; Wed, 29 Nov 2023 18:38:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701311913; cv=none; d=google.com; s=arc-20160816; b=j0FCq8vjsCv2YJlPXFVrAPQo6769wBksj2ACMVVqksVvx9QLCuIJs0HnV+fckwePWI sN6JIeNZlUzcOcB9SXBbm3tD1suAp0kFUAn7st+9IdazHSREvHnKBngriVwUJZ7R4QS+ H4l51hXZ1m6r78AMkzpPS5uhnSFZStjY8tIHANY/0/ieHaqVBaZLVJ+F6Q3K9K9BGqLA 5DO9d85Jaq+akPEqbJM4YQGm55qs5kRDy1QyBtXMCNNHBRXuRGX97UXTNl1sA6FPAdR2 WyK8/CtFhtHHxLc5BRbDhuacf/8Hp3o3UhgQaduLvbd3uVstrs5Yv53E0D1OeCwgbZU7 GTRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=S7OvprRVzCQVTy9nlCCqrmLv57KjBqPf/71FHcnZ2wQ=; fh=jKijsxc1Z2CHKVFf4S4lB42jMLcn6gTpewOn4Tq1/VM=; b=Ijp/nV2EaewxaWlmHYjeVg0yrgD0WZ8Hq7XVKPthLXVJWxPMN58WPQjvhnnmesufXd Wav8GIFfu2+2aXq+nq3EvfwP4mZoq10h1Dqf3645dhxkMETZn1vxUQnCcNy/+AuFczJq K8dJiYl4C1aGjSId/eKVm50/bGSxLExLF5k2IgAipkwxlxOI/MPwm1yvKaihYr+j0u/K fLORcqy3eMefmtGszXD5yXr5DTK/4eB0vhP5qsm5992YsUuJ0vy5MtMWt0x0HlvI8g14 itRCmzuGZVW5cqOZ9XXUW/ktQvqg45Q13DASnYDuYYOjxYFILQA1bPO8qAm2brorLo05 7t/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dvVUGnsU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id df9-20020a056a00470900b006c339c0cc08si174130pfb.196.2023.11.29.18.38.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 18:38:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dvVUGnsU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2CD7E806E4FF; Wed, 29 Nov 2023 18:38:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344283AbjK3CiS (ORCPT + 99 others); Wed, 29 Nov 2023 21:38:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234966AbjK3CiC (ORCPT ); Wed, 29 Nov 2023 21:38:02 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20EA01724 for ; Wed, 29 Nov 2023 18:37:38 -0800 (PST) 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 29 Nov 2023 18:38:32 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783954840864663598 X-GMAIL-MSGID: 1783954840864663598 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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^