From patchwork Sat Feb 17 00:58:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13561143 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 96011C48BF6 for ; Sat, 17 Feb 2024 00:59:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A8D0E6B0092; Fri, 16 Feb 2024 19:58:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A3E216B0093; Fri, 16 Feb 2024 19:58:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DC6C6B0096; Fri, 16 Feb 2024 19:58:54 -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 7997D6B0092 for ; Fri, 16 Feb 2024 19:58:54 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 20A9B4011E for ; Sat, 17 Feb 2024 00:58:54 +0000 (UTC) X-FDA: 81799486188.18.BA632B8 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf03.hostedemail.com (Postfix) with ESMTP id D29DE20003 for ; Sat, 17 Feb 2024 00:58:51 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ab1s7a8Z; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf03.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 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=1708131532; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rkytF4J4Jg9lwSSrwHvDWXBUGqs0QkBT9IVd0tsJCJ4=; b=PGjPX1IzswvzsGIN2qFRN9Mp9ATWJN04ZWiWKcjtNgDSeX9AE11tSjyy3sqbfozZ74gbhS G2S3ULVuGg6zfcvJC6yUvaomUIcLTnk3Mb9/h60bMahI7X3vPsVv+liqv9WlLZpq1q0lLF b+gVIRJadquybiWbioRkOyluhMffpLk= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ab1s7a8Z; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf03.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708131532; a=rsa-sha256; cv=none; b=C64mDQQvKQZnFJ9EYYKW/L6aA+QNlm5t7v9Fzk3QfO4TjkTGXt+oG0drSeZm/EE/IcspLl 8Ka4perql3qpotodhp182tfYSK+C+1nfFruqMxPTo9vS9t82CEXMYOZpGXqZ+Rd4vR1AIE XL/cR+lTgOPXuYVcWVcsgbdh0cG9BQA= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C1798CE2D74; Sat, 17 Feb 2024 00:58:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A969C43394; Sat, 17 Feb 2024 00:58:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708131528; bh=ZF7Ys29G8g/k6D1jFHkNld6ID7JrPCUQzMebjrLS5cc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ab1s7a8ZVMd65Gov613sVFUA9Z1HOsB0ADjuIBE2ac+9N/3GFt/fZ3Jh3yqR3KlAU ZBCbYFIJ/7sYSlVdaUALdwiw7n5Vz70vwWf/AMYu6WrYE30mAQ5MznaR6kRP2y/VwZ eApMMw8nps4ukwaCWHjwmqguvLzL6Z7xRQBAmFLZfPLPv5aG9wQAYvZvMcvBsKcOTQ go4PJwvFy2JnFHrjrtignzt40wD0jMQVyWcqbkCYt37sb71r90hFvv3Ib8T5u9ZP9w P1SYlEYr2cLkqkL8Q/QYAVJOpFM2r/ZPc5tslHjzZIMxnD2DQGrKbNzR5QMRQkwm0G TEa6NN702cKYQ== 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 2/5] Docs/mm/damon: move the list of DAMOS actions to design doc Date: Fri, 16 Feb 2024 16:58:39 -0800 Message-Id: <20240217005842.87348-3-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240217005842.87348-1-sj@kernel.org> References: <20240217005842.87348-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: D29DE20003 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 53oniehdbs7ppff6mjg1yt8hqx8gf58z X-HE-Tag: 1708131531-7676 X-HE-Meta: U2FsdGVkX18uLmyOQlqeEnXo3PDsnCUrdL2kQDk6jIVp0pBFYQOqVFHgG0qWUOREinD0CIGVk5b/J4tJwQAoyAEhVPsZwcha951X3/eLg9F8NOGDQwdIoZ6Grd4W04oWzIpIA1xN5P+76Tb10kMSkkrY3uWyTFgUtaewq59/zsKfVllJcFljQEh5cVYD8xbAEqvKp2RCZyLTKx/X5j8zk3x/dSLCaNDBGv4GbeBZyA7W8s7cy/Pv3AYO/b/WbQThm1XGEJEbeulwX3iK5w3yRWTRRO5d57Fguhy7CWtV8Egkq0jQ72OUiSpJSisjAkKOsY3nbB2rZWl5wEd9oJRlyWKxnhO7eUzFIzmEQbXaaG4EiotxdItomGEjZGz+E0SAsYzb18cU6f8u9W30vXYMAQgPTJ2NVOTVVQ06Lu5Q1jg7go2Tma4/mT14UfpLtO5YMdEqmys50WU/74UF4bDfthMV1xA9kB7MNiqr8XJLfk6S4N7sRoZdVhAM0nA0Riuuvdf/ErWVWC+Ns2CrcCF5qcU9TFwEOABYCR+kqSHOvHUDjayAUbgeEMoN5+JpOm8UTFHoJW7jEhPuhYwRd8xSM5wAANE6cY4cGj1qsP4L7B6GCCRpsr9oymxGzcrvwEv9kOnWGONCDXpUa00uJ1VPIAy5k5hwagDnZDtb4SK4Se+q8P3Om25OcHMZV/GdDskWsCo+ckf3zOUJoVBIRtpDK05X2ZYHdcFXNQyAhm2uEvEy5PW2QXmDJkH5foJ7K2dttNMCRuonJAWv3xD+fizGefeGZbS25QZdpSYmC244z/i0Sjc8FJuB+A0/OWKyHqAiuChGO1o9bWQILx3KsLZabF8VJp5v4OCCBwws4cEoTbrC16aex7w6TgSHitTEoYQAkB9CmJ/XDHDuqenzgXCrbT6nJ4WYk2J5HHET6kRj+lif2yzcNB4n50rZhl3sVHpKUKKcxU+/5Ui8olkj+Qc qOxevt+A hfEl+6zTco+H3okCsYg14oYHFtefm62BrbJ8Dw5PVMvomoAHckTFt9CXtlsxu3d2tiOGS7ZNDt8nIFdmSd63O6ty48ylND3sWHFJGJjIZB+x4XpJOj7movAU2HYaPeZcmv3MeDIs6X9HPYBYkBVFqa8OHN8wuqZAzRp2uNMZUtIPuUOqweu0t0/WJ64J8sItzpLAOnGsw54vNJnbL/p51tc1i4+ApGS9kdJsfcOPf7MnLPxLjNXRAKMSIdGgrWoNuejDLMy50e2juAD8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000005, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: DAMOS operation actions are explained nearly twice on the DAMON usage document, once for the sysfs interface, and then again for the debugfs interface. Duplication is bad. Also it would better to keep this kind of concept level details in design document and keep the usage document small and focus on only the usage. Move the list to design document and update usage document to reference it. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 47 ++++++-------------- Documentation/mm/damon/design.rst | 26 +++++++++-- 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index 58c34e66b31b..0335d584956b 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -302,27 +302,8 @@ In each scheme directory, five directories (``access_pattern``, ``quotas``, The ``action`` file is for setting and getting the scheme's :ref:`action `. The keywords that can be written to and read -from the file and their meaning are as below. - -Note that support of each action depends on the running DAMON operations set -:ref:`implementation `. - - - ``willneed``: Call ``madvise()`` for the region with ``MADV_WILLNEED``. - Supported by ``vaddr`` and ``fvaddr`` operations set. - - ``cold``: Call ``madvise()`` for the region with ``MADV_COLD``. - Supported by ``vaddr`` and ``fvaddr`` operations set. - - ``pageout``: Call ``madvise()`` for the region with ``MADV_PAGEOUT``. - Supported by ``vaddr``, ``fvaddr`` and ``paddr`` operations set. - - ``hugepage``: Call ``madvise()`` for the region with ``MADV_HUGEPAGE``. - Supported by ``vaddr`` and ``fvaddr`` operations set. - - ``nohugepage``: Call ``madvise()`` for the region with ``MADV_NOHUGEPAGE``. - Supported by ``vaddr`` and ``fvaddr`` operations set. - - ``lru_prio``: Prioritize the region on its LRU lists. - Supported by ``paddr`` operations set. - - ``lru_deprio``: Deprioritize the region on its LRU lists. - Supported by ``paddr`` operations set. - - ``stat``: Do nothing but count the statistics. - Supported by all operations sets. +from the file and their meaning are same to those of the list on +:ref:`design doc `. The ``apply_interval_us`` file is for setting and getting the scheme's :ref:`apply_interval ` in microseconds. @@ -763,19 +744,17 @@ Action ~~~~~~ The ```` is a predefined integer for memory management :ref:`actions -`. The supported numbers and their meanings are as -below. - - - 0: Call ``madvise()`` for the region with ``MADV_WILLNEED``. Ignored if - ``target`` is ``paddr``. - - 1: Call ``madvise()`` for the region with ``MADV_COLD``. Ignored if - ``target`` is ``paddr``. - - 2: Call ``madvise()`` for the region with ``MADV_PAGEOUT``. - - 3: Call ``madvise()`` for the region with ``MADV_HUGEPAGE``. Ignored if - ``target`` is ``paddr``. - - 4: Call ``madvise()`` for the region with ``MADV_NOHUGEPAGE``. Ignored if - ``target`` is ``paddr``. - - 5: Do nothing but count the statistics +`. The mapping between the ```` values and +the memory management actions is as below. For the detailed meaning of the +action and DAMON operations set supporting each action, please refer to the +list on :ref:`design doc `. + + - 0: ``willneed`` + - 1: ``cold`` + - 2: ``pageout`` + - 3: ``hugepage`` + - 4: ``nohugepage`` + - 5: ``stat`` Quota ~~~~~ diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index 1bb69524a62e..9f16c4e62e72 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -294,9 +294,29 @@ not mandated to support all actions of the list. Hence, the availability of specific DAMOS action depends on what operations set is selected to be used together. -Applying an action to a region is considered as changing the region's -characteristics. Hence, DAMOS resets the age of regions when an action is -applied to those. +The list of the supported actions, their meaning, and DAMON operations sets +that supports each action are as below. + + - ``willneed``: Call ``madvise()`` for the region with ``MADV_WILLNEED``. + Supported by ``vaddr`` and ``fvaddr`` operations set. + - ``cold``: Call ``madvise()`` for the region with ``MADV_COLD``. + Supported by ``vaddr`` and ``fvaddr`` operations set. + - ``pageout``: Call ``madvise()`` for the region with ``MADV_PAGEOUT``. + Supported by ``vaddr``, ``fvaddr`` and ``paddr`` operations set. + - ``hugepage``: Call ``madvise()`` for the region with ``MADV_HUGEPAGE``. + Supported by ``vaddr`` and ``fvaddr`` operations set. + - ``nohugepage``: Call ``madvise()`` for the region with ``MADV_NOHUGEPAGE``. + Supported by ``vaddr`` and ``fvaddr`` operations set. + - ``lru_prio``: Prioritize the region on its LRU lists. + Supported by ``paddr`` operations set. + - ``lru_deprio``: Deprioritize the region on its LRU lists. + Supported by ``paddr`` operations set. + - ``stat``: Do nothing but count the statistics. + Supported by all operations sets. + +Applying the actions except ``stat`` to a region is considered as changing the +region's characteristics. Hence, DAMOS resets the age of regions when any such +actions are applied to those. .. _damon_design_damos_access_pattern: