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: 13563007 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 F04AAC48BC3 for ; Mon, 19 Feb 2024 19:44:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B7B9A6B0082; Mon, 19 Feb 2024 14:44:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A69876B0088; Mon, 19 Feb 2024 14:44:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C2BB6B008A; Mon, 19 Feb 2024 14:44:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 5CC736B0082 for ; Mon, 19 Feb 2024 14:44:45 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id BABA01403C2 for ; Mon, 19 Feb 2024 19:44:44 +0000 (UTC) X-FDA: 81809580888.06.A494614 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf06.hostedemail.com (Postfix) with ESMTP id 0A65D18001C for ; Mon, 19 Feb 2024 19:44:42 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=q3JlR1TM; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708371883; 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=SRDCctGY6qtGU8lGbKUE5wni1l67EM3vmJhAhZajsSA=; b=tDKhhhEzBhIXeZY6kpurHDFH1oetRFvpnOgpUHfBmIS9qQUt9Ug5t54BVJ1klol062X6AX huK36v6a+pkfBmBXgtEnoR9rRT/qVWBMjXmc+7ZV/LSnS9tY34FQy62zBvd8Sq/UU26Avb lpB3Fhp4CWTIen1D+irA4QvbKjWKx+c= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=q3JlR1TM; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708371883; a=rsa-sha256; cv=none; b=aoWJeUHJ37/oP8+Q+xObr1QPg1H55be/hzc4j3c1ggH3s47A8ygu9u6ukL8fDaymarDeUh VNqyEAsKYu0U7aws8DpDp7Xp3VsK1YxST+GkdBD3ctakDxJ85oqE+/ygMW61WnrSTt+hRY u8xfKVyx2MJhiJu0DLzZc8Jr1xzNSyA= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 209ED60F7C; Mon, 19 Feb 2024 19:44:42 +0000 (UTC) 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> MIME-Version: 1.0 X-Rspamd-Queue-Id: 0A65D18001C X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: fhejpwp1s6ksu8unii96qzw1ro1g9gtq X-HE-Tag: 1708371882-484456 X-HE-Meta: U2FsdGVkX18sgsNZSRLB+wnUDFk0C7+jRpYFXsPYqllCRT4AZUJtdLyW6X3J5kEteGibL4eqO11OGdap4nCTHBofLMZwhXxJKZuET2GiYRg5OnAA/cEwpURqEpX9tbreReNk4NTZx95zXDFoZZPuo4cXQm3yQkrTRHrGMY2ubG4qZqpOXx3V4QfuMgCIkj9amPBbhURWRxJZzMnrp39PG2zkfn9gs0zzDMWUo2eO1c/d1KJ0PT0C23ehOvdw0lrXzrSgfQzsVUe3bVDRVuxyEtvqnIApdT8P4YSvuem8ySuCeddioXuxyq4UdydgbxGVy/MPrq4d/YVFwfcZFOika9PsnVQluo0NoPip85G/2S8+zs/uei5jJyyIPbG7HNJB4os0TKuE5YF7gKX5kBUQZs9iKAF/f2Vt2AuFX2u4Z78lriGxBI8CsIe4ffGFHmrh8+NrmYYBTmTeN9DkeSJBtvyOi86iKGKKYxmgg6fyRSeMtmKzLeIJETyIFIX0ZYcdwbAOiUFw0c+iLeczqm1Q0IzoTSqM4FJPCV7gr+y+YUbQ5JoRnEUaowajOKGTVVhfrWDdpX+vlCzWOBsNMpD9UPo+wZDCDvfeMMFJ/zLicUZOPkJ8C0au+IsDR55e/Smt2909Fjlqt9EPqVNrS7ja1lsZTpc8f6SN81dYaSRAofqB9JDYJ3QLUbsFLvgL+BBighh9YESYIGnFAuv8xrjAyT/vlqsVCJM/DXQoPcyn562q7QzMWnirD04qnvf7bYBP/n4tahjrtdBWfTgShVMUWRWd2atEY9XsOalKBmevnvblhSQ57+qpNo/QbFPio51jriJ3RkKv/+8jiUYGf5AFd4V37ZASwsVGFDCkYqz3tLkoh3ayeToI6p9XuINX3pDJljUuNZWPOkVbaTzfL+HVB6CRPie2VRph1De7stJqP0w+DzdIwnuPVAcppARL/wDjJ7jrbH+uuxfeGPQ8Qb7 qP4iwZNy KVxwP7T/mmxAtQ/2egCVv8GOgQDcXlmQ9u+T0Wm0YwCaiAj1r5WzKZ7v8L4W0o3bh36NN8JKLGukyKH9ftC89oyx9GPetwJgbrGPz4UsbVOI9j/cC3tHLsnokqxd9c7bnaXhWtmzUsADGrVsUQOyZE2PnkosLWduI39QiMlbMNuG5iM/qhGtYRksCRd88xZmkTXwJJleC/qD4edsYY5TewTA4BF02WIGJw9rj/xHEZgGt1htLc6Hn+Hz70le/0WnU93nVhhwe9Mu25ShYwQWUIqQ6fd2Wa1YcSNQ4Y24XDwPN1DlPWxv2tCT/qIxhmoJiaDU9jYsq5de2mMJkbGc0iDPhWQ== 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 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