Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp27358rdb; Wed, 29 Nov 2023 18:38:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHn12l6tLsgE7S6HE1EOZe+8opvDNmnupExJRLFctvCil1xqRq8BLG6cnt/g8uhmnhpTKE X-Received: by 2002:a17:90a:df04:b0:280:74ce:ae8d with SMTP id gp4-20020a17090adf0400b0028074ceae8dmr22526747pjb.20.1701311914106; Wed, 29 Nov 2023 18:38:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701311914; cv=none; d=google.com; s=arc-20160816; b=NLa5H4CRZjceiwJxc5GMJD3TiO+MDp0wM8QdpENqBBuCgV+2/wwF2ly+pOwmuzYfDs QBuuprTvBRt00D8oLwVOFu+DDrn/WitJ2OMkz+LdtLGsROdV80zaKpEO3BqgHDRA1qj4 Kjxp4NhvfcwJ5t0rM/eOuyIGavrlPQTreCbjfMANK4NHDdcpx16UK6jYg93bnLbv6g00 rzBZBu1uNwn27ZcByiMOK6fv6Q29BzWSraZWlfQx00P5LNVC6IE9r3lo/8J5fgMN+K7e uaCVFi3IU1FLxk7gtK8HV9x2L/xgwgIhGMA6EMgAYVFbiDdst9YS/+HSqmblu+0VXVtu GbUA== 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 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id pi13-20020a17090b1e4d00b0028105ba769fsi302573pjb.149.2023.11.29.18.38.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 18:38:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; 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 2620:137:e000::3:7 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 077E3802AF33; Wed, 29 Nov 2023 18:38:33 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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:33 -0800 (PST) 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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- 2.34.1