From nobody Sat Feb 7 20:40:33 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32655C7EE29 for ; Thu, 25 May 2023 21:43:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241743AbjEYVn2 (ORCPT ); Thu, 25 May 2023 17:43:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234142AbjEYVnX (ORCPT ); Thu, 25 May 2023 17:43:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBC3012C; Thu, 25 May 2023 14:43:22 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 615AD64B71; Thu, 25 May 2023 21:43:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45DB8C4339B; Thu, 25 May 2023 21:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685051001; bh=hVFyQUZN1gcvG6t3Dpq635c426eBMKWXinhJ3HGYh9s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HGI9nQarh6/dDMgWqzLaHz2tcFxHEP3FNk3dJo770kxOgy8E0LJyKAqlE+8jo5Iz7 i1gdU/pd6W2jdEXcJru8gg5rlqj9E45F1fCDuQrxTcO5pnOKEUwGjm+1FkxK4Xje9E rIstQEBLmrKi1/p3JTjltsB0DJRnx+6PTnB7SSxulUpBkLLqNXOof1II5O73QtnHMf Auoe2QSPd8MXvUeutyKUrr57FVkUT9ujcnYjjm0IQ2rChSTKMJk449mIHEOBcc3nII kjX50inG7/9hu/5DIb2MKMSXYvHO+KTXbg3InDmIR6bxFsoDsRhMxBZwGRIivtd4Sc r79YnXhY6S1wg== 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 01/10] Docs/mm/damon/faq: remove old questions Date: Thu, 25 May 2023 21:43:05 +0000 Message-Id: <20230525214314.5204-2-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230525214314.5204-1-sj@kernel.org> References: <20230525214314.5204-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The first two questions of DAMON faqs have raised when DAMON patches were first submitted. More than one year has passed since DAMON patches get merged in the mainline, and that kind of questions are not asked nowadays. Remove the questions. Signed-off-by: SeongJae Park --- Documentation/mm/damon/faq.rst | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/Documentation/mm/damon/faq.rst b/Documentation/mm/damon/faq.rst index dde7e2414ee6..3279dc7a8211 100644 --- a/Documentation/mm/damon/faq.rst +++ b/Documentation/mm/damon/faq.rst @@ -4,29 +4,6 @@ Frequently Asked Questions =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D =20 -Why a new subsystem, instead of extending perf or other user space tools? -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - -First, because it needs to be lightweight as much as possible so that it c= an be -used online, any unnecessary overhead such as kernel - user space context -switching cost should be avoided. Second, DAMON aims to be used by other -programs including the kernel. Therefore, having a dependency on specific -tools like perf is not desirable. These are the two biggest reasons why D= AMON -is implemented in the kernel space. - - -Can 'idle pages tracking' or 'perf mem' substitute DAMON? -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D - -Idle page tracking is a low level primitive for access check of the physic= al -address space. 'perf mem' is similar, though it can use sampling to minim= ize -the overhead. On the other hand, DAMON is a higher-level framework for the -monitoring of various address spaces. It is focused on memory management -optimization and provides sophisticated accuracy/overhead handling mechani= sms. -Therefore, 'idle pages tracking' and 'perf mem' could provide a subset of -DAMON's output, but cannot substitute DAMON. - - Does DAMON support virtual memory only? =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 --=20 2.25.1 From nobody Sat Feb 7 20:40:33 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BBFDC77B7E for ; Thu, 25 May 2023 21:43:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241946AbjEYVnb (ORCPT ); Thu, 25 May 2023 17:43:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241879AbjEYVnY (ORCPT ); Thu, 25 May 2023 17:43:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BAFB134; Thu, 25 May 2023 14:43:23 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 186D164B66; Thu, 25 May 2023 21:43:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C201C4339C; Thu, 25 May 2023 21:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685051002; bh=pAFa7HjQcx+ryoZoo4sJVjdW99Hl1Us5CqTxI7BWAYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z1A0tFYgWDn5FVYiNaylQFNzXACGLTl6XaeSun3nAY6cxd7j4cbM62HvjMInzXGVF ITZMEKzaOKPGGv7WAHa4kK6HXx/Vz1uPfJTn9s8RpNji2siobULCWgMXZbNJLjPMHs 2/ACgdIDPn4BifqOaxC/TI36gn1iZHLXPwpLXx714PesThwWjpJPQpRSdcE11AfXye apBJRMF5DdsyTAoCWbiaMtzVy5g0fFbBYk7tMGx1iplnT4Ya4b6m4vhurRrgTEBJVG CqaLEW/orZWTA7XaqCGzDPRzgnRwy0ceUKdt/QjssIqIUAb9UHndd6BNi10PHd0Ph9 w4ppJKX97Umzw== 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 02/10] Docs/mm/damon/maintainer-profile: fix typos and grammar errors Date: Thu, 25 May 2023 21:43:06 +0000 Message-Id: <20230525214314.5204-3-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230525214314.5204-1-sj@kernel.org> References: <20230525214314.5204-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Fix a few typos and grammar erros in DAMON Maintainer Profile document. Signed-off-by: SeongJae Park --- Documentation/mm/damon/maintainer-profile.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/mm/damon/maintainer-profile.rst b/Documentation/= mm/damon/maintainer-profile.rst index 24a202f03de8..a84c14e59053 100644 --- a/Documentation/mm/damon/maintainer-profile.rst +++ b/Documentation/mm/damon/maintainer-profile.rst @@ -3,7 +3,7 @@ DAMON Maintainer Entry Profile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =20 -The DAMON subsystem covers the files that listed in 'DATA ACCESS MONITOR' +The DAMON subsystem covers the files that are listed in 'DATA ACCESS MONIT= OR' section of 'MAINTAINERS' file. =20 The mailing lists for the subsystem are damon@lists.linux.dev and @@ -15,7 +15,7 @@ SCM Trees =20 There are multiple Linux trees for DAMON development. Patches under development or testing are queued in damon/next [2]_ by the DAMON maintain= er. -Suffieicntly reviewed patches will be queued in mm-unstable [1]_ by the me= mory +Sufficiently reviewed patches will be queued in mm-unstable [1]_ by the me= mory management subsystem maintainer. After more sufficient tests, the patches= will be queued in mm-stable [3]_ , and finally pull-requested to the mainline b= y the memory management subsystem maintainer. --=20 2.25.1 From nobody Sat Feb 7 20:40:33 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AC95C7EE2C for ; Thu, 25 May 2023 21:43:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241960AbjEYVne (ORCPT ); Thu, 25 May 2023 17:43:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241885AbjEYVnZ (ORCPT ); Thu, 25 May 2023 17:43:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B410FB; Thu, 25 May 2023 14:43:24 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id C4F1064B74; Thu, 25 May 2023 21:43:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B759DC4339E; Thu, 25 May 2023 21:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685051003; bh=NrQxqhDPJ98oboAlR28uGqZUlrS5AmTee+Fa9XTxEmk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HMEhL3qQzSUfgwpeBq+8adhjQX0oA4pjhIziNSyjvfCrbF07AwIQT5mklBCXNW4El ROYP9lK+EThF92y9nRLfHJuEWU1NKEtpaIIT3mXlie0WS4ayg6fTmMMImd9+G3nRcY rJ6eJlL4H6bqb+IIyAikKIcjHEgRmAm/WCk3WEBYhgNB1wsoa+ihRuDldcZhlI7erU JSKB8p5tAF8CiYaxOprLoQhCBSkcvD0IOpIMrA9tHfym3lVX38jT5MD1NMFtDVc0mB vvrrDIAKi7niiwB8aSS7dmA0rjtv9HQpKPqXvVqRW2ZO6Uo7dfTRWRdGDVpzr7f8vG ItX0vPPjynI1Q== 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 03/10] Docs/mm/damon/design: add a section for overall architecture Date: Thu, 25 May 2023 21:43:07 +0000 Message-Id: <20230525214314.5204-4-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230525214314.5204-1-sj@kernel.org> References: <20230525214314.5204-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The design doc is missing overall picture of DAMON. Add a section for overall architeucture and layers. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 0cff6fac6b7e..3b4ce873fa71 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -4,6 +4,21 @@ Design =3D=3D=3D=3D=3D=3D =20 + +Overall Architecture +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +DAMON subsystem is configured with three layers including + +- Operations Set: Implements fundamental operations for DAMON that depends= on + the given monitoring target address-space and available set of + software/hardware primitives, +- Core: Implements core logics including monitoring overhead/accurach cont= rol + and access-aware system operations on top of the operations set layer, a= nd +- Modules: Implements kernel modules for various purposes that provides + interfaces for the user space, on top of the core layer. + + Configurable Layers =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 --=20 2.25.1 From nobody Sat Feb 7 20:40:33 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C81CC7EE29 for ; Thu, 25 May 2023 21:43:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241971AbjEYVnh (ORCPT ); Thu, 25 May 2023 17:43:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241915AbjEYVn0 (ORCPT ); Thu, 25 May 2023 17:43:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA0BA12C; Thu, 25 May 2023 14:43:24 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 8B91464B75; Thu, 25 May 2023 21:43:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FC00C433EF; Thu, 25 May 2023 21:43:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685051004; bh=GDYnOCmR9taeLPi11qkRjJOP5JKJ+SKnVQLPWS9novo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sm66ncKTjd+QyK0/mKdZ2zUyUEX/24G5aM3/NnaMM53ZqmMolOjDQdXnpxWvXkPrZ xVdPCE2X+IQA/H5pnFnmzbre0Yi4CuEg6MvoI1KuC4N/YdmtpKGqDH54/x9qKPRBl2 C3aiKztWzNc62p9d9ceWUBmoiZbFZHmt+kQ3Z2qhmL0zkZbtm9SV+DewauTDlp7SL4 sIKnTVcDThUbT2aFIP+9Mi2A5QLIPCcKLz2fyJs/mxe/XkVozkH77Xf8NZ8VZRUF13 Zik9/tM+ygV+5FwhARYsu/xmcOjgGc0MA0bPW5scFNE4SBfH+y+vaIjdtUPz9bF+Q8 6iD6bMZ2wuNFA== 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 04/10] Docs/mm/damon/design: update the layout based on the layers Date: Thu, 25 May 2023 21:43:08 +0000 Message-Id: <20230525214314.5204-5-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230525214314.5204-1-sj@kernel.org> References: <20230525214314.5204-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" DAMON design document is describing only the operations set layer and monitoring part of the core logic. Update the layout based on the DAMON's layers, so that more parts of DAMON including DAMOS core logic and DAMON modules can easily be added. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 3b4ce873fa71..eaf52f3a9144 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -19,8 +19,8 @@ DAMON subsystem is configured with three layers including interfaces for the user space, on top of the core layer. =20 =20 -Configurable Layers -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Configurable Operations Set +--------------------------- =20 DAMON provides data access monitoring functionality while making the accur= acy and the overhead controllable. The fundamental access monitorings require @@ -42,8 +42,8 @@ Also, if some architectures or devices support special op= timized access check primitives, those will be easily configurable. =20 =20 -Reference Implementations of Address Space Specific Monitoring Operations -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Operations Set Layer +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 The monitoring operations are defined in two parts: =20 @@ -105,8 +105,12 @@ conflict with the reclaim logic using ``PG_idle`` and = ``PG_young`` page flags, as Idle page tracking does. =20 =20 -Address Space Independent Core Mechanisms -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Core Logics +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + + +Monitoring +---------- =20 Below four sections describe each of the DAMON core mechanisms and the five monitoring attributes, ``sampling interval``, ``aggregation interval``, @@ -115,7 +119,7 @@ regions``. =20 =20 Access Frequency Monitoring ---------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~ =20 The output of DAMON says what pages are how frequently accessed for a given duration. The resolution of the access frequency is controlled by setting @@ -142,7 +146,7 @@ size of the target workload grows. =20 =20 Region Based Sampling ---------------------- +~~~~~~~~~~~~~~~~~~~~~ =20 To avoid the unbounded increase of the overhead, DAMON groups adjacent pag= es that assumed to have the same access frequencies into a region. As long a= s the @@ -159,7 +163,7 @@ assumption is not guaranteed. =20 =20 Adaptive Regions Adjustment ---------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~ =20 Even somehow the initial monitoring target regions are well constructed to fulfill the assumption (pages in same region have similar access frequenci= es), @@ -178,7 +182,7 @@ keeping the bounds users set for their trade-off. =20 =20 Dynamic Target Space Updates Handling -------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =20 The monitoring target address range could dynamically changed. For exampl= e, virtual memory could be dynamically mapped and unmapped. Physical memory = could --=20 2.25.1 From nobody Sat Feb 7 20:40:33 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6C63C77B7E for ; Thu, 25 May 2023 21:43:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241972AbjEYVnl (ORCPT ); Thu, 25 May 2023 17:43:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235214AbjEYVn0 (ORCPT ); Thu, 25 May 2023 17:43:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E2FF134; Thu, 25 May 2023 14:43:25 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 4846764B7C; Thu, 25 May 2023 21:43:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36A86C433AA; Thu, 25 May 2023 21:43:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685051004; bh=kRx7Ql+X4ob3mmhrjF9h89mhxljZdGi0sjiE1FJX5Zc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZRtNgrzlQpPWHCCJkCxIGW1T5QYX30ZV8PyfpuCpNijZF9fG2o9gwhI6hI1HuJuXB hEwvfN7QVmwNyqjHfLLBfdaSIwkwvAeh4ai3YycdDhNdLrn/guKnvJYpJxeSa1o32c m2WjEJiDsMxQNDzClBhV3o2/T/UchbSiFGGtIQ+d0lsE1tOsOIlXxCuEgOEhMSMPla JQJBV6ZYCoZXflk0PqwtzFGyYe6sLxQAQ7MU1tQjmuPzm2vL+AiCHkc4D7ehrXqizE HD1eVdUSAJxbUwSnSU5CRNkR6EqAb+1My+CxxAybPlhXoNzE+GHkvt7oYzk5/Nb5Bk kz20ij5EG1pUQ== 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/10] Docs/mm/damon/design: rewrite configurable layers Date: Thu, 25 May 2023 21:43:09 +0000 Message-Id: <20230525214314.5204-6-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230525214314.5204-1-sj@kernel.org> References: <20230525214314.5204-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The 'Configurable Operations Set' section is a little bit outdated. Update the text. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index eaf52f3a9144..4a22bab124cf 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -22,24 +22,23 @@ DAMON subsystem is configured with three layers includi= ng Configurable Operations Set --------------------------- =20 -DAMON provides data access monitoring functionality while making the accur= acy -and the overhead controllable. The fundamental access monitorings require -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. We call the = low -level primitives implementations monitoring operations. - -Due to this separated design and the configurable interface, users can ext= end -DAMON for any address space by configuring the core logics with appropriate -monitoring operations. If appropriate one is not provided, users can impl= ement -the operations on their own. +For data access monitoring and additional low level work, DAMON needs a se= t of +implementations for specific operations that are dependent on and optimize= d for +the given target address space. On the other hand, the accuracy and overh= ead +tradeoff mechanism, which is the core logic of DAMON, is in the pure logic +space. DAMON separates the two parts in different layers, namely DAMON +Operations Set and DAMON Core Logics Layers, respectively. It further def= ines +the interface between the layers to allow various operations sets to be +configured with the core logic. + +Due to this design, users can extend DAMON for any address space by config= uring +the core logic to use the appropriate operations set. If any appropriate = set +is unavailable, users can implement one on their own. =20 For example, physical memory, virtual memory, swap space, those for specif= ic processes, NUMA nodes, files, and backing memory devices would be supporta= ble. -Also, if some architectures or devices support special optimized access ch= eck -primitives, those will be easily configurable. +Also, if some architectures or devices supporting special optimized access +check primitives, those will be easily configurable. =20 =20 Operations Set Layer --=20 2.25.1 From nobody Sat Feb 7 20:40:33 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00D70C7EE2C for ; Thu, 25 May 2023 21:43:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229589AbjEYVno (ORCPT ); Thu, 25 May 2023 17:43:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241922AbjEYVn1 (ORCPT ); Thu, 25 May 2023 17:43:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61A21FB; Thu, 25 May 2023 14:43:26 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id F189864B5E; Thu, 25 May 2023 21:43:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3F02C4339C; Thu, 25 May 2023 21:43:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685051005; bh=ajEgfoPi4mQLMDMHVEFRgzRHD6TvLlqgYGgpcmGScQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m66zBEyUfmCHCn8eqRJo7jy6hhFYE0z8qSqIKv/ocFre/3j2zl5dAs3Q+xajxI8Xc tn1D02jKcsAEw4JkGIcrrZwanKto7rchuYRxJZPQRgI2D75KsdZJF4gAS0w5P/yMjQ gZi6aD5/uwDKpNNfZuMeFBUYsE+40xXMBc8AleEf2Ugq4ZvcEyjNx0lejmzbQQB6hF VGQwiHmC1aruQ6iCJRhSpAR+J/LuCA3aWm3G7Iiq5o4kfPjbVQ1yVBKc4ItrzTpwNn TJpbfOOkBKWNXrJaJfS79kjCqRs1jkR9Q0LdkTMCJJBSz46ITvg+2Oatux3sBcFoGt ciBVpJ/GZEb3g== 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 06/10] Docs/mm/damon/design: add a section for the relation between Core and Modules layer Date: Thu, 25 May 2023 21:43:10 +0000 Message-Id: <20230525214314.5204-7-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230525214314.5204-1-sj@kernel.org> References: <20230525214314.5204-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add overall desription of the interface and the relation between the Core and the Modules layer under 'Overall Architecture' section. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 4a22bab124cf..41abd0430dd7 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -41,6 +41,16 @@ Also, if some architectures or devices supporting specia= l optimized access check primitives, those will be easily configurable. =20 =20 +Programmable Modules +-------------------- + +Core layer of DAMON is implemented as a framework, and exposes its applica= tion +programming interface to all kernel space components such as subsystems and +modules. For common use cases of DAMON, DAMON subsystem provides kernel +modules that built on top of the core layer using the API, which can be ea= sily +used by the user space end users. + + Operations Set Layer =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 --=20 2.25.1 From nobody Sat Feb 7 20:40:33 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 989E4C77B7E for ; Thu, 25 May 2023 21:43:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241987AbjEYVns (ORCPT ); Thu, 25 May 2023 17:43:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241926AbjEYVn2 (ORCPT ); Thu, 25 May 2023 17:43:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9BC512C; Thu, 25 May 2023 14:43:26 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id BA7B164B75; Thu, 25 May 2023 21:43:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C31EC4339E; Thu, 25 May 2023 21:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685051006; bh=APr09IDiXGykzuGGa19YHF7doztMwWo2QuV04whzSE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nzbBk6KCaeEKjgaCqUIVU5hTiLijuoQ2H2aJfAUzxi/UVr0w7ei8EnEamotAgKXfL 1JF/RgO5UylZl9FlBIpP399R6mpJfXhfU8jx72dyC0YDzfWvAjkDaf22nyQ9VIRqeY Xc1e1uEfUPDeYFysPQ5t9qDZVJhWXzg5djp9FRE5fSGQuimSe0YWEqmJwuoR1rQPUG G6i6YnbO3iJYJqgyTvJVVAByL5/4lUEU039yAGDyAX0TIFjzqJFJatQ/no1KeLwdNx G84vkoXyWM1gRPfQVIfhW57qQ2wnQ8HyVM7PXxMOYP2YxHQXN6+/hlIyR+gXywy4Pt niR+/fxAA9vmw== 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 07/10] Docs/mm/damon/design: add sections for basic parts of DAMOS Date: Thu, 25 May 2023 21:43:11 +0000 Message-Id: <20230525214314.5204-8-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230525214314.5204-1-sj@kernel.org> References: <20230525214314.5204-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" DAMOS is an important part of DAMON, but the design doc is not covering it. Add sections for covering the basic part of DAMOS. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 41abd0430dd7..9f9253529c3d 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -202,3 +202,73 @@ monitoring operations to check dynamic changes includi= ng 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``). + + +Operation Schemes +----------------- + +One common purpose of data access monitoring is access-aware system effici= ency +optimizations. For example, + + paging out memory regions that are not accessed for more than two minu= tes + +or + + using THP for memory regions that are larger than 2 MiB and showing a = high + access frequency for more than one minute. + +One straightforward approach for such schemes would be profile-guided +optimizations. That is, getting data access monitoring results of the +workloads or the system using DAMON, finding memory regions of special +characteristics by profiling the monitoring results, and making system +operation changes for the regions. The changes could be made by modifying= or +providing advice to the software (the application and/or the kernel), or +reconfiguring the hardware. Both offline and online approaches could be +available. + +Among those, providing advice to the kernel at runtime would be flexible a= nd +effective, and therefore widely be used. However, implementing such sche= mes +could impose unnecessary redundancy and inefficiency. The profiling could= be +redundant if the type of interest is common. Exchanging the information +including monitoring results and operation advice between kernel and user +spaces could be inefficient. + +To allow users to reduce such redundancy and inefficiencies by offloading = the +works, DAMON provides a feature called Data Access Monitoring-based Operat= ion +Schemes (DAMOS). It lets users specify their desired schemes at a high +level. For such specifications, DAMON starts monitoring, finds regions ha= ving +the access pattern of interest, and applies the user-desired operation act= ions +to the regions as soon as found. + + +Operation Action +~~~~~~~~~~~~~~~~ + +The management action that the users desire to apply to the regions of the= ir +interest. For example, paging out, prioritizing for next reclamation vict= im +selection, advising ``khugepaged`` to collapse or split, or doing nothing = but +collecting statistics of the regions. + +The list of supported actions is defined in DAMOS, but the implementation = of +each action is in the DAMON operations set layer because the implementation +normally depends on the monitoring target address space. For example, the= code +for paging specific virtual address ranges out would be different from tha= t for +physical address ranges. And the monitoring operations implementation set= s are +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. + + +Target Access Pattern +~~~~~~~~~~~~~~~~~~~~~ + +The access pattern of the schemes' interest. The patterns are constructed= with +the properties that DAMON's monitoring results provide, specifically the s= ize, +the access frequency, and the age. Users can describe their access patter= n of +interest by setting minimum and maximum values of the three properties. I= f a +region's three properties are in the ranges, DAMOS classifies it as one of= the +regions that the scheme is having an interest in. --=20 2.25.1 From nobody Sat Feb 7 20:40:33 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50B75C77B7E for ; Thu, 25 May 2023 21:43:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232799AbjEYVnv (ORCPT ); Thu, 25 May 2023 17:43:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241928AbjEYVn2 (ORCPT ); Thu, 25 May 2023 17:43:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95840FB; Thu, 25 May 2023 14:43:27 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 775BE64B5E; Thu, 25 May 2023 21:43:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 628EAC433A1; Thu, 25 May 2023 21:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685051006; bh=AEj9qz2MGylaqhssIqrE5GKEjpK4WMFP3qXqID5+yXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hyX8pFa7iyjjjRl1mWdTIaxIwE+6WFCkNPN3hr1dMZUbd+dPKp0C5ADoR9CsBve9e bnXfddX2Lx5JKSre0HSsSFXWjoS0veM3uj+tf9iB6+Z3B731NSUoWlbJviUioTQ2T+ TKiuM2414KdPdO+JIp3/GNkwfs/OPQ8Kv2HhHogrZ9mMs1xAmQ3Qf9buiZMjoEaKiK Kyz8vNjhJVeAsCPtdFGbqmUnKclrt1FiidxrBYcPx3a9bTxGCHM2JVKZ9hKVBwngoN 4YbweD3aLPcS6BAaaKehmKagw4Rjm1HyNFMbf+Tz63hB2AVFEEhlTZRQGCXYuzgqq0 D1HuQ9bJBt11g== 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 08/10] Docs/mm/damon/design: add sections for advanced features of DAMOS Date: Thu, 25 May 2023 21:43:12 +0000 Message-Id: <20230525214314.5204-9-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230525214314.5204-1-sj@kernel.org> References: <20230525214314.5204-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add sections for advanced features of DAMOS including quotas, prioritization, watermarks, and filters of DAMOS on the design document. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 86 +++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 9f9253529c3d..706dbc17c6cb 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -272,3 +272,89 @@ the access frequency, and the age. Users can describe= their access pattern of interest by setting minimum and maximum values of the three properties. I= f a region's three properties are in the ranges, DAMOS classifies it as one of= the regions that the scheme is having an interest in. + + +Quotas +~~~~~~ + +DAMOS upper-bound overhead control feature. DAMOS could incur high overhe= ad if +the target access pattern is not properly tuned. For example, if a huge m= emory +region having the access pattern of interest is found, applying the scheme= 's +action to all pages of the huge region could consume unacceptably large sy= stem +resources. Preventing such issues by tuning the access pattern could be +challenging, especially if the access patterns of the workloads are highly +dynamic. + +To mitigate that situation, DAMOS provides an upper-bound overhead control +feature called quotas. It lets users specify an upper limit of time that = DAMOS +can use for applying the action, and/or a maximum bytes of memory regions = that +the action can be applied within a user-specified time duration. + + +Prioritization +^^^^^^^^^^^^^^ + +A mechanism for making a good decision under the quotas. When the action +cannot be applied to all regions of interest due to the quotas, DAMOS +prioritizes regions and applies the action to only regions having high eno= ugh +priorities so that it will not exceed the quotas. + +The prioritization mechanism should be different for each action. For exa= mple, +rarely accessed (colder) memory regions would be prioritized for page-out +scheme action. In contrast, the colder regions would be deprioritized for= huge +page collapse scheme action. Hence, the prioritization mechanisms for each +action are implemented in each DAMON operations set, together with the act= ions. + +Though the implementation is up to the DAMON operations set, it would be c= ommon +to calculate the priority using the access pattern properties of the regio= ns. +Some users would want the mechanisms to be personalized for their specific +case. For example, some users would want the mechanism to weigh the recen= cy +(``age``) more than the access frequency (``nr_accesses``). DAMOS allows = users +to specify the weight of each access pattern property and passes the +information to the underlying mechanism. Nevertheless, how and even wheth= er +the weight will be respected are up to the underlying prioritization mecha= nism +implementation. + + +Watermarks +~~~~~~~~~~ + +Conditional DAMOS (de)activation automation. Users might want DAMOS to run +only under certain situations. For example, when a sufficient amount of f= ree +memory is guaranteed, running a scheme for proactive reclamation would only +consume unnecessary system resources. To avoid such consumption, the user= would +need to manually monitor some metrics such as free memory ratio, and turn +DAMON/DAMOS on or off. + +DAMOS allows users to offload such works using three watermarks. It allow= s the +users to configure the metric of their interest, and three watermark value= s, +namely high, middle, and low. If the value of the metric becomes above the +high watermark or below the low watermark, the scheme is deactivated. If = the +metric becomes below the mid watermark but above the low watermark, the sc= heme +is activated. If all schemes are deactivated by the watermarks, the monit= oring +is also deactivated. In this case, the DAMON worker thread only periodica= lly +checks the watermarks and therefore incurs nearly zero overhead. + + +Filters +~~~~~~~ + +Non-access pattern-based target memory regions filtering. If users run +self-written programs or have good profiling tools, they could know someth= ing +more than the kernel, such as future access patterns or some special +requirements for specific types of memory. For example, some users may know +only anonymous pages can impact their program's performance. They can also +have a list of latency-critical processes. + +To let users optimize DAMOS schemes with such special knowledge, DAMOS pro= vides +a feature called DAMOS filters. The feature allows users to set an arbitr= ary +number of filters for each scheme. Each filter specifies the type of targ= et +memory, and whether it should exclude the memory of the type (filter-out),= or +all except the memory of the type (filter-in). + +As of this writing, anonymous page type and memory cgroup type are support= ed by +the feature. Some filter target types can require additional arguments. = For +example, the memory cgroup filter type asks users to specify the file path= of +the memory cgroup for the filter. Hence, users can apply specific schemes= to +only anonymous pages, non-anonymous pages, pages of specific cgroups, all = pages +excluding those of specific cgroups, and any combination of those. --=20 2.25.1 From nobody Sat Feb 7 20:40:33 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A222C7EE29 for ; Thu, 25 May 2023 21:43:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242011AbjEYVny (ORCPT ); Thu, 25 May 2023 17:43:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241930AbjEYVn3 (ORCPT ); Thu, 25 May 2023 17:43:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 571DA187; Thu, 25 May 2023 14:43:28 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 2FF3664B7B; Thu, 25 May 2023 21:43:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FD41C4339C; Thu, 25 May 2023 21:43:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685051007; bh=ZSCtM5xpPfxl9ZcGY7kbIAlY3W8XFj4VJBVoZq5mrJw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nUwAJi3+gowT9HAFkMA0ZZUXqK2ioGmXpGUdjFB/arrg1Po32AkJnMJW3vr1F8fVE qRIBYNlqXONIP0Ej+C7cc/MCaVrcckNuW4yEzQ7sIBvgdjWCbVpn/lCXKn9b9fu0oI dnlfRUcIp1zYYpGfvXXb55umKr+yvpGgN6M8KjTixK6MXezkXnfeA8fDKIZecHpPWf LGfcobjbi87gaaplEvo3xfU+sQkC+jAp+vvInameYiGl+KrtIbhVILbRJUl+1HcQeX 7mgDcXYZqiVLlOp1U/byyRYiOev/QYdoYXqSwsMA4SMhMeCfWNDbss1MhsUNGpdt+1 8LcZKj9Jmx1eA== 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 09/10] Docs/mm/damon/design: add a section for DAMON core API Date: Thu, 25 May 2023 21:43:13 +0000 Message-Id: <20230525214314.5204-10-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230525214314.5204-1-sj@kernel.org> References: <20230525214314.5204-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add a section covering the API of DAMON core layer on the design document. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 706dbc17c6cb..0ccdd2f6af9f 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -358,3 +358,15 @@ example, the memory cgroup filter type asks users to s= pecify the file path of the memory cgroup for the filter. Hence, users can apply specific schemes= to only anonymous pages, non-anonymous pages, pages of specific cgroups, all = pages excluding those of specific cgroups, and any combination of those. + + +Application Programming Interface +--------------------------------- + +The programming interface for kernel space data access-aware applications. +DAMON is a framework, so it does nothing by itself. Instead, it only helps +other kernel components such as subsystems and modules building their data +access-aware applications using DAMON's core features. For this, DAMON ex= poses +its all features to other kernel components via its application programming +interface, namely ``include/linux/damon.h``. Please refer to the API +:doc:`document ` for details of the interface. --=20 2.25.1 From nobody Sat Feb 7 20:40:33 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40598C7EE29 for ; Thu, 25 May 2023 21:44:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242012AbjEYVn6 (ORCPT ); Thu, 25 May 2023 17:43:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241948AbjEYVnd (ORCPT ); Thu, 25 May 2023 17:43:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A2B6189; Thu, 25 May 2023 14:43:29 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id E05C864B6C; Thu, 25 May 2023 21:43:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEB18C4339B; Thu, 25 May 2023 21:43:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685051008; bh=FlZuBr64knJ/8JP07S/l782gvTE23ogKRh6IGqK2gr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oQoq8UhP0KDP7dsBgoau7JHv8ZbqA6Mk7eyiEYs20eSZPB60Mjy409eVD8M/aQbcD mhvONiRVkwQMiWpQGy2aEq1iysz8wQCGutpD9He8OmINpO43C2I9f5UyxRx6vhrG4Z GwcABZVvgk4YVQjaRrLPmRteCzz0RDRcEUGPTHo7kGfrm/9Wut7jkkoODWdXCwnyqL 2QSlv7J+B+eRSGGOID/CsZSG7dx3wZpcXnLYkLriEdYkwxsu2Cwwh9ggRTJ9ddWH/H TYT5d7LSPqBsKYp11iYGrWaFXldnJdRFsJi8Mfohaq/HnpLfAVzXP4HIjxacxLtoHc acztIb1xTvRQA== 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 10/10] Docs/mm/damon/design: add a section for the modules layer Date: Thu, 25 May 2023 21:43:14 +0000 Message-Id: <20230525214314.5204-11-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230525214314.5204-1-sj@kernel.org> References: <20230525214314.5204-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add a section for covering DAMON modules layer to the design document. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 61 +++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 0ccdd2f6af9f..da110e89cab4 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -370,3 +370,64 @@ access-aware applications using DAMON's core features.= For this, DAMON exposes its all features to other kernel components via its application programming interface, namely ``include/linux/damon.h``. Please refer to the API :doc:`document ` for details of the interface. + + +Modules +=3D=3D=3D=3D=3D=3D=3D + +Because the core of DAMON is a framework for kernel components, it doesn't +provide any direct interface for the user space. Such interfaces should be +implemented by each DAMON API user kernel components, instead. DAMON subs= ystem +itself implements such DAMON API user modules, which are supposed to be us= ed +for general purpose DAMON control and special purpose data access-aware sy= stem +operations, and provides stable application binary interfaces (ABI) for the +user space. The user space can build their efficient data access-aware +applications using the interfaces. + + +General Purpose User Interface Modules +-------------------------------------- + +DAMON modules that provide user space ABIs for general purpose DAMON usage= in +runtime. + +DAMON user interface modules, namely 'DAMON sysfs interface' and 'DAMON de= bugfs +interface' are DAMON API user kernel modules that provide ABIs to the +user-space. Please note that DAMON debugfs interface is currently depreca= ted. + +Like many other ABIs, the modules create files on sysfs and debugfs, allow +users to specify their requests to and get the answers from DAMON by writi= ng to +and reading from the files. As a response to such I/O, DAMON user interfa= ce +modules control DAMON and retrieve the results as user requested via the D= AMON +API, and return the results to the user-space. + +The ABIs are designed to be used for user space applications development, +rather than human beings' fingers. Human users are recommended to use such +user space tools. One such Python-written user space tool is available at +Github (https://github.com/awslabs/damo), Pypi +(https://pypistats.org/packages/damo), and Fedora +(https://packages.fedoraproject.org/pkgs/python-damo/damo/). + +Please refer to the ABI :doc:`document ` for +details of the interfaces. + + +Special-Purpose Access-aware Kernel Modules +------------------------------------------- + +DAMON modules that provide user space ABI for specific purpose DAMON usage. + +DAMON sysfs/debugfs user interfaces are for full control of all DAMON feat= ures +in runtime. For each special-purpose system-wide data access-aware system +operations such as proactive reclamation or LRU lists balancing, the inter= faces +could be simplified by removing unnecessary knobs for the specific purpose= , and +extended for boot-time and even compile time control. Default values of D= AMON +control parameters for the usage would also need to be optimized for the +purpose. + +To support such cases, yet more DAMON API user kernel modules that provide= more +simple and optimized user space interfaces are available. Currently, two +modules for proactive reclamation and LRU lists manipulation are provided.= For +more detail, please read the usage documents for those +(:doc:`/admin-guide/mm/damon/reclaim` and +:doc:`/admin-guide/mm/damon/lru_sort`). --=20 2.25.1