From patchwork Tue Feb 22 17:00:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12755686 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 09063C433FE for ; Tue, 22 Feb 2022 17:01:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7AB128D0003; Tue, 22 Feb 2022 12:01:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 73A5B8D0005; Tue, 22 Feb 2022 12:01:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F9968D0003; Tue, 22 Feb 2022 12:01:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0125.hostedemail.com [216.40.44.125]) by kanga.kvack.org (Postfix) with ESMTP id 505BE8D0001 for ; Tue, 22 Feb 2022 12:01:13 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 08D4D9F84D for ; Tue, 22 Feb 2022 17:01:13 +0000 (UTC) X-FDA: 79171031226.15.2046836 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf22.hostedemail.com (Postfix) with ESMTP id 15A28C0014 for ; Tue, 22 Feb 2022 17:01:11 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id EF41BCE138F; Tue, 22 Feb 2022 17:01:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6580C340F3; Tue, 22 Feb 2022 17:01:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645549267; bh=39aGM7NlOoLZpgmNi6MB1SzF9U7sSJm7tFXEV8C9jgk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PpeSxOdgieBpb2HuJ2xeqElm5eBKelijp+KKuEHrsZVQf2uVih8WkryyO5VjnHslG xhG1Ipx94wrXOt3k5GiH+oaL0ai0Cna2OdVMpphGkNqNdWOaZeMxcfRgIiIkbXJywM oBjAO3qVoJMEqj8h5XU6/LVZjYyvQV0NI/p4Kqv+4eJaeb/ZYI/+0vPVAhICqC6DQg kOlyjy6cELoOpT54nyXNx29QZMFk6U3y9JYG9ZBv5Wrzbp6m6OY6WwDiLaUd7a1yOr iPtvNslEfFykVS0lHm0JT5Vp9sK52Xf+GwJDvQaADFJPn9AUKLgmevv+v/hU6QKMFC vtoGfRQLae27w== From: SeongJae Park To: akpm@linux-foundation.org Cc: corbet@lwn.net, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 1/3] Docs/vm/damon: Call low level monitoring primitives the operations Date: Tue, 22 Feb 2022 17:00:58 +0000 Message-Id: <20220222170100.17068-2-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220222170100.17068-1-sj@kernel.org> References: <20220222170100.17068-1-sj@kernel.org> Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=PpeSxOdg; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 15A28C0014 X-Stat-Signature: 6hqmnqranr84zxtgwke15tefyykd3bdq X-HE-Tag: 1645549271-967803 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: DAMON code calls the low level monitoring primitives implementations the monitoring operations. The documentation would have no problem at still calling those primitives implementation because there is no real difference in the concepts, but making it more consistent with the code would make it better. This commit therefore convert sentences in the doc specifically pointing the implementations of the primitives to call it monitoring operations. Signed-off-by: SeongJae Park --- Documentation/vm/damon/design.rst | 24 ++++++++++++------------ Documentation/vm/damon/faq.rst | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Documentation/vm/damon/design.rst b/Documentation/vm/damon/design.rst index 210f0f50efd8..c406983aeb31 100644 --- a/Documentation/vm/damon/design.rst +++ b/Documentation/vm/damon/design.rst @@ -13,12 +13,13 @@ primitives that dependent on and optimized for the target address space. On the other hand, the accuracy and overhead tradeoff mechanism, which is the core of DAMON, is in the pure logic space. DAMON separates the two parts in different layers and defines its interface to allow various low level -primitives implementations configurable with the core logic. +primitives implementations configurable with the core logic. We call the low +level primitives implementations monitoring operations. Due to this separated design and the configurable interface, users can extend -DAMON for any address space by configuring the core logics with appropriate low -level primitive implementations. If appropriate one is not provided, users can -implement the primitives on their own. +DAMON for any address space by configuring the core logics with appropriate +monitoring operations. If appropriate one is not provided, users can implement +the operations on their own. For example, physical memory, virtual memory, swap space, those for specific processes, NUMA nodes, files, and backing memory devices would be supportable. @@ -26,25 +27,24 @@ Also, if some architectures or devices support special optimized access check primitives, those will be easily configurable. -Reference Implementations of Address Space Specific Primitives -============================================================== +Reference Implementations of Address Space Specific Monitoring Operations +========================================================================= -The low level primitives for the fundamental access monitoring are defined in -two parts: +The monitoring operations are defined in two parts: 1. Identification of the monitoring target address range for the address space. 2. Access check of specific address range in the target space. -DAMON currently provides the implementations of the primitives for the physical +DAMON currently provides the implementations of the operations for the physical and virtual address spaces. Below two subsections describe how those work. VMA-based Target Address Range Construction ------------------------------------------- -This is only for the virtual address space primitives implementation. That for -the physical address space simply asks users to manually set the monitoring -target address ranges. +This is only for the virtual address space monitoring operations +implementation. That for the physical address space simply asks users to +manually set the monitoring target address ranges. Only small parts in the super-huge virtual address space of the processes are mapped to the physical memory and accessed. Thus, tracking the unmapped diff --git a/Documentation/vm/damon/faq.rst b/Documentation/vm/damon/faq.rst index 11aea40eb328..dde7e2414ee6 100644 --- a/Documentation/vm/damon/faq.rst +++ b/Documentation/vm/damon/faq.rst @@ -31,7 +31,7 @@ Does DAMON support virtual memory only? ======================================= No. The core of the DAMON is address space independent. The address space -specific low level primitive parts including monitoring target regions +specific monitoring operations including monitoring target regions constructions and actual access checks can be implemented and configured on the DAMON core by the users. In this way, DAMON users can monitor any address space with any access check technique. From patchwork Tue Feb 22 17:00:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12755687 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 23B90C4332F for ; Tue, 22 Feb 2022 17:01:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AD1988D0005; Tue, 22 Feb 2022 12:01:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A3F7E8D0001; Tue, 22 Feb 2022 12:01:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 849E48D0006; Tue, 22 Feb 2022 12:01:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id 6FF948D0001 for ; Tue, 22 Feb 2022 12:01:13 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2C0B39F852 for ; Tue, 22 Feb 2022 17:01:13 +0000 (UTC) X-FDA: 79171031226.16.AF6F622 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf13.hostedemail.com (Postfix) with ESMTP id 3E27120018 for ; Tue, 22 Feb 2022 17:01:12 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id B0E93CE179E; Tue, 22 Feb 2022 17:01:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A545EC340F8; Tue, 22 Feb 2022 17:01:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645549268; bh=zczrBUwLoWWJDqN/LSpEpzKjXn8SCxPYGivrQ5ZiP8o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IwL5+TbBccR6OcEoiUZfWmcmA8QotsmGv4C2wgrrwoEQxR7w2LxbqvV6A2U3IfoIv D0EIEGHjZuO8O90pyyiVSUtMm9yOg5jBkQyJ0C4SrUywjtWZ31/2vyutVDCPdYtrDy rrA9WUwTY3nkZ1GeVKhZFyFehuvUEYcVk26YiL3V8tgDNKvOJUCzhCVq+7PSrGDzif e7ipovYGaP0eeq1cCWDuKcCVqkjv9Tg3FsouJuLM/w2SBn551ut2mwQ6ABAixth47n RIJnw+SMGxA4eoEodU6eFoeQ9cqC9zuweae8ckpuRkw6pdw9bwjjZ+agj3YEaS3dTO u4qUOFx0IwJBQ== From: SeongJae Park To: akpm@linux-foundation.org Cc: corbet@lwn.net, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 2/3] Docs/vm/damon/design: Update DAMON-Idle Page Tracking interference handling Date: Tue, 22 Feb 2022 17:00:59 +0000 Message-Id: <20220222170100.17068-3-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220222170100.17068-1-sj@kernel.org> References: <20220222170100.17068-1-sj@kernel.org> X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=IwL5+TbB; spf=pass (imf13.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 3E27120018 X-Stat-Signature: 4scsqxbxw4ypt8n88qfeacodzqqwka8u X-HE-Tag: 1645549272-711416 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000037, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: In DAMON's early development stage before it be merged in the mainline, it was first designed to work exclusively with Idle page tracking to avoid any interference between each other. Later, but still before be merged in the mainline, because Idle page tracking is fully under the control of sysadmins, we made the resolving of conflict as the responsibility of sysadmins. The document is not updated for the change, though. This commit updates the document for that. Signed-off-by: SeongJae Park --- Documentation/vm/damon/design.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/vm/damon/design.rst b/Documentation/vm/damon/design.rst index c406983aeb31..bba89632e924 100644 --- a/Documentation/vm/damon/design.rst +++ b/Documentation/vm/damon/design.rst @@ -84,9 +84,10 @@ table having a mapping to the address. In this way, the implementations find and clear the bit(s) for next sampling target address and checks whether the bit(s) set again after one sampling period. This could disturb other kernel subsystems using the Accessed bits, namely Idle page tracking and the reclaim -logic. To avoid such disturbances, DAMON makes it mutually exclusive with Idle -page tracking and uses ``PG_idle`` and ``PG_young`` page flags to solve the -conflict with the reclaim logic, as Idle page tracking does. +logic. DAMON does nothing to avoid disturbing Idle page tracking, so handling +the interference is the responsibility of sysadmins. However, it solves the +conflict with the reclaim logic using ``PG_idle`` and ``PG_young`` page flags, +as Idle page tracking does. Address Space Independent Core Mechanisms From patchwork Tue Feb 22 17:01:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12755688 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 7F547C433EF for ; Tue, 22 Feb 2022 17:01:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F23A58D0006; Tue, 22 Feb 2022 12:01:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EAB8F8D0001; Tue, 22 Feb 2022 12:01:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D23B88D0006; Tue, 22 Feb 2022 12:01:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id BE06F8D0001 for ; Tue, 22 Feb 2022 12:01:15 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 8B811120F3A for ; Tue, 22 Feb 2022 17:01:15 +0000 (UTC) X-FDA: 79171031310.09.2ECA33D Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf10.hostedemail.com (Postfix) with ESMTP id 6EF5FC0012 for ; Tue, 22 Feb 2022 17:01:13 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 633CECE17AA; Tue, 22 Feb 2022 17:01:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60D93C340F9; Tue, 22 Feb 2022 17:01:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645549268; bh=U1WoaJ7lbnns8naY/1+W0bLu1qPxUeglQsjIh920zbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q0f6a+m7QBkb6m90qVbP/bQOXJLehC8assGKbnwnzG2ooCM4dGXeX8GNBtnNjIHNa GxFtRJMWSSZzeVZay9Ntg+FgiMvHS83XYziKa80YKhc4JesxqjmML309ul0D7oVpIT 7Uc9L+NvEhAtjo99Hc9O7/nnqq4Ak32j066QgxSqODSbd85lpwptVuC/OFNgdi12bM lEE6cJmAmYtyPsDnzifcqjev5KHMf9bso+KfAK3ZwX3bDOp1zLFv0F9GQDkXiXd89j 9zaqyHlqyG1wj1qsOYKCyWYNgux8NGalLPzUraP9Vy3P4WsNTX/6iBdFH/KmSiFNtY PA0+s26xkEsxA== From: SeongJae Park To: akpm@linux-foundation.org Cc: corbet@lwn.net, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 3/3] Docs/damon: Update outdated term 'regions update interval' Date: Tue, 22 Feb 2022 17:01:00 +0000 Message-Id: <20220222170100.17068-4-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220222170100.17068-1-sj@kernel.org> References: <20220222170100.17068-1-sj@kernel.org> X-Rspam-User: Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=q0f6a+m7; spf=pass (imf10.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 6EF5FC0012 X-Stat-Signature: cohoqxcfkcko6gfb1qouhaupf8gijynb X-HE-Tag: 1645549273-259501 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000028, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Before DAMON is merged in the mainline, the concept of 'regions update interval' has generalized to be used as the time interval for update of any monitoring operations related data structure, but the document has not updated properly. This commit updates the document for better consistency. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 6 +++--- Documentation/vm/damon/design.rst | 12 +++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index 1e06435b8ff6..b6ec650873b2 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -47,7 +47,7 @@ Attributes ---------- Users can get and set the ``sampling interval``, ``aggregation interval``, -``regions update interval``, and min/max number of monitoring target regions by +``update interval``, and min/max number of monitoring target regions by reading from and writing to the ``attrs`` file. To know about the monitoring attributes in detail, please refer to the :doc:`/vm/damon/design`. For example, below commands set those values to 5 ms, 100 ms, 1,000 ms, 10 and @@ -128,8 +128,8 @@ ranges, ``20-40`` and ``50-100`` as that of pid 4242, which is the second one Note that this sets the initial monitoring target regions only. In case of virtual memory monitoring, DAMON will automatically updates the boundary of the -regions after one ``regions update interval``. Therefore, users should set the -``regions update interval`` large enough in this case, if they don't want the +regions after one ``update interval``. Therefore, users should set the +``update interval`` large enough in this case, if they don't want the update. diff --git a/Documentation/vm/damon/design.rst b/Documentation/vm/damon/design.rst index bba89632e924..0cff6fac6b7e 100644 --- a/Documentation/vm/damon/design.rst +++ b/Documentation/vm/damon/design.rst @@ -95,8 +95,8 @@ Address Space Independent Core Mechanisms Below four sections describe each of the DAMON core mechanisms and the five monitoring attributes, ``sampling interval``, ``aggregation interval``, -``regions update interval``, ``minimum number of regions``, and ``maximum -number of regions``. +``update interval``, ``minimum number of regions``, and ``maximum number of +regions``. Access Frequency Monitoring @@ -169,6 +169,8 @@ The monitoring target address range could dynamically changed. For example, virtual memory could be dynamically mapped and unmapped. Physical memory could be hot-plugged. -As the changes could be quite frequent in some cases, DAMON checks the dynamic -memory mapping changes and applies it to the abstracted target area only for -each of a user-specified time interval (``regions update interval``). +As the changes could be quite frequent in some cases, DAMON allows the +monitoring operations to check dynamic changes including memory mapping changes +and applies it to monitoring operations-related data structures such as the +abstracted monitoring target memory area only for each of a user-specified time +interval (``update interval``).