From patchwork Mon Feb 19 19:44:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 203234 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp5667dyc; Mon, 19 Feb 2024 11:46:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXbCue3cBiTdBp+ZrEkyqrZL+quDR6wrgpPGCjYziQ/t/FnoNKUjxvz15aG71satA/X5x6cdSNPtjgyjFspDbbTwiXJWA== X-Google-Smtp-Source: AGHT+IE6nWz83H89T9I/71gOS8fEz9HVQEmTNu5ecTp+VIeYUwn7AzgJfjV/6kwH2wmPek+xrSzD X-Received: by 2002:a05:6a21:3a47:b0:19e:ad09:a571 with SMTP id zu7-20020a056a213a4700b0019ead09a571mr18535126pzb.29.1708371985691; Mon, 19 Feb 2024 11:46:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708371985; cv=pass; d=google.com; s=arc-20160816; b=WN22l4xHpDk2O7cHJ6+uwZcwLLYVvFvpmB0htOK9NCeJsdJWmMX6cKnMe6EnG4YOrV Icq77bs+x480H1/yi/pgyRa0ehDV4HohTunWCwN06qxHZSpvzVzqzCC8M5IuxGSyjcR4 LoA1OdBe4zzQoFkfv2zu4DiUpYBA0spZu7Bme7DxooI+/Gw1wxOFRFotiQMAB17KL8S6 3gb0PwAuQaLvOnHx6fulQzqMCN6cgT+yeHrXjXsSsOElKkxXcmBvRGWiNzExPoFfpG8T Qw28aYp//pML2pDUCT04maKFooTQy5zvjaxfMxou+SaKE9mIRp6u38S3uEYu8LWzUyai oOaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=SRDCctGY6qtGU8lGbKUE5wni1l67EM3vmJhAhZajsSA=; fh=jKijsxc1Z2CHKVFf4S4lB42jMLcn6gTpewOn4Tq1/VM=; b=uuhwt9cfvwuIsmVNyenpyd9Sn0j9wGz3H9o3djoBq2ip6MtaIoUzeh4GQWGd1BhElr 08zLsx5JSO4FefhLJyPrX43rmuKDCK8YUk/0Xwr+FaduDpCqMVwvm5+6leTz6/i0kWAC 7Z5xRzBOL6RS+C/Ry/Y27OZECk6a1Bb2jiReP+uxzk2N0Puc2UAGxMNf2LmsPxbeBixT z0HUR1jHh/2DXDKjwoFLJNP7kROypxb8ILUm2M50mvfb6LxncalrNyoS3KtS6Nkwqi8K b5Znpgwo/zI+5v7bWbKJahk9XU58q7L08bG5RkX0d2G7ZYHYL2ck7PRIxRfBAf84dcA/ X2UQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q3JlR1TM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-71886-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71886-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w30-20020a63af1e000000b005cdde899923si4896608pge.758.2024.02.19.11.46.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 11:46:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71886-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q3JlR1TM; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-71886-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71886-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6C4C5282623 for ; Mon, 19 Feb 2024 19:46:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 09D985644B; Mon, 19 Feb 2024 19:44:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="q3JlR1TM" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5FE2153812; Mon, 19 Feb 2024 19:44:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708371882; cv=none; b=NrsgyozpI2TaRqjFRLxxjJVbO+NdnAayliLZ1U/NhI1CmcYz4Td4wwuJcBhqtowF/6isEnJIL4LSjBtJMmj4RnKJYAlqdbHvKU/zsyjdNNCo0o0eIUFK5VwURH+/SGWlr2NHlISn80b40wgmwoZRKxO1AvC1dEiAXsLJpr8wcqY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708371882; c=relaxed/simple; bh=Kc80eiLjIjFfjUUzf1ec4uqhs3PwKD70+PMFGRlYm9w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ZtM0fisApGOZqxpID6NWTfxehVIF3d1C0ICJYNYxqxyAwaAchrCtbFrxtRpBIJFOeeGkx8JQduFVtAMcNGwqf/OhhzOrd0J76vb8k/c1V2NSA5W60Bw4r+1om1780lPg2Ely4EJGO3XteVAjfCL8I0QX3upudhbUGiixeZqxvxo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=q3JlR1TM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E787C43390; Mon, 19 Feb 2024 19:44:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708371881; bh=Kc80eiLjIjFfjUUzf1ec4uqhs3PwKD70+PMFGRlYm9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q3JlR1TMBd4SZipJkxguG3s3i9iwsqiUwe8NWYu9g5VarCQPcboEKYUol/8Ltw02/ 7lVy4f/dwVLcQIzZq2RwxsBGYZPGlnDwh/ncGthYhY+xGOxovBI2rk5qA8CmR4V3P3 rOgyHFgBbl7gBF7thKUeezEPey8JCAxfIjN1twH61U5pqFdIxT4PvAa4FHXrrhIGiu SUCph24Jhh8qdoNRJzRpTQnRUE1/Y3Xx91lMc263hFrZIgsAzmpfyQ+84r5OHWFwKQ cJ7bWU4XUwCN1ukCpTJBEgtQk1D5I6a6/1+YdOXyMFDGXpSrXK3/fhvNVVsDoZ+ZTV f7hbn9PJKUiPg== 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 05/20] Docs/admin-guide/mm/damon/usage: document effective_bytes file Date: Mon, 19 Feb 2024 11:44:16 -0800 Message-Id: <20240219194431.159606-6-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240219194431.159606-1-sj@kernel.org> References: <20240219194431.159606-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791357863025956538 X-GMAIL-MSGID: 1791357863025956538 Update DAMON usage document for the effective quota file of the DAMON sysfs interface. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index db6620b5bc0a..220ebbde7324 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -83,7 +83,7 @@ comma (","). │ │ │ │ │ │ │ │ sz/min,max │ │ │ │ │ │ │ │ nr_accesses/min,max │ │ │ │ │ │ │ │ age/min,max - │ │ │ │ │ │ │ :ref:`quotas `/ms,bytes,reset_interval_ms + │ │ │ │ │ │ │ :ref:`quotas `/ms,bytes,reset_interval_ms,effective_bytes │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil │ │ │ │ │ │ │ │ :ref:`goals `/nr_goals │ │ │ │ │ │ │ │ │ 0/target_value,current_value @@ -153,6 +153,9 @@ Users can write below commands for the kdamond to the ``state`` file. - ``clear_schemes_tried_regions``: Clear the DAMON-based operating scheme action tried regions directory for each DAMON-based operation scheme of the kdamond. +- ``update_schemes_effective_bytes``: Update the contents of + ``effective_bytes`` files for each DAMON-based operation scheme of the + kdamond. For more details, refer to :ref:`quotas directory `. If the state is ``on``, reading ``pid`` shows the pid of the kdamond thread. @@ -320,8 +323,9 @@ schemes//quotas/ The directory for the :ref:`quotas ` of the given DAMON-based operation scheme. -Under ``quotas`` directory, three files (``ms``, ``bytes``, -``reset_interval_ms``) and two directores (``weights`` and ``goals``) exist. +Under ``quotas`` directory, four files (``ms``, ``bytes``, +``reset_interval_ms``, ``effective_bytes``) 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, @@ -332,6 +336,15 @@ apply the action to only up to ``bytes`` bytes of memory regions within the quota limits unless at least one :ref:`goal ` is set. +The time quota is internally transformed to a size quota. Between the +transformed size quota and user-specified size quota, smaller one is applied. +Based on the user-specified :ref:`goal `, the +effective size quota is further adjusted. Reading ``effective_bytes`` returns +the current effective size quota. The file is not updated in real time, so +users should ask DAMON sysfs interface to update the content of the file for +the stats by writing a special keyword, ``update_schemes_effective_bytes`` to +the relevant ``kdamonds//state`` file. + Under ``weights`` directory, three files (``sz_permil``, ``nr_accesses_permil``, and ``age_permil``) exist. You can set the :ref:`prioritization weights