From nobody Wed Dec 17 04:37:17 2025 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 28DC016F839; Mon, 1 Jul 2024 19:27:12 +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=1719862032; cv=none; b=q8u57kTCL2+Yd+b4K7Q4h9+VnUcQix23C/gBiaBwIv+vqVksdYLSgOVMDzhglBjk/Sibc8ZTR49xBaSvALjc4tkyLMdlsEafa2WzuBMpdfcBTj6MZiPTUQ6Ta3BD5E5b7ppsZX5o+Stb4lXg74Xeey6NkrE4F2Wv5Nqt8jwZyIQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719862032; c=relaxed/simple; bh=QYtOsoHg40YEBAD6vy86pU8pE6QF4gmCEDYVeoDEr90=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FDE5M9OeJS8gpkY6JCIj6dq4L7lSSmqUDob6AhTFHp5V9a/t98bqaQMAsvnWIodnqjWvIOVFkrapwbRdmRhorZ+bf3kDWnQsOPreiOBTMAVglvNxmKOFdYmAVMae4KfgHo1QaLvDapqE+MF/TA6zoXCTpxjAsVEkcUkV54+XJb4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OIXekkpC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OIXekkpC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81E2AC4AF0A; Mon, 1 Jul 2024 19:27:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719862032; bh=QYtOsoHg40YEBAD6vy86pU8pE6QF4gmCEDYVeoDEr90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OIXekkpClCpeAyF/agJ4pi4kJcklJISQ3HTbSRrR/nQKlhbKVw33QHjyTWCFKL/rg joC6RuKMtx5R24WQe3yhGAFj4TLqxXJK7uwQLDlz+wNNLY+BJ94OaK3oW74hWjnN4f BByybX1lYAV7PayI5RTe6Uppm1AOLrMiG7mzczUqLIzioPz1RldLSV99Bl7Zu+A2FA DTaiOCPOwMPG1KHskLGBjubQ9V+gA85MR/dBwjvCWYWKpK404Jx5F5j0LiMYnHQ8bs 7nEKrTL8L14bVCL8/h0csDnA7vcu3N05hxdcqWOv9dfk4EJPUn8po6Umh4r1LO4Tce 3T62d3lH3fwcA== 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 1/9] Docs/mm/damon/design: fix two typos Date: Mon, 1 Jul 2024 12:26:58 -0700 Message-Id: <20240701192706.51415-2-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240701192706.51415-1-sj@kernel.org> References: <20240701192706.51415-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Fix two typos. The first one is just a simple typo: s/accurach/accuracy/ The second one is made by the author being out of their mind. 'Region Based Sampling' section of the doc is mistakenly calling the access frequency counter of region as 'nr_regions'. Fix it with the correct name, 'nr_accesses'. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 3f12c884eb3a..6beb245cbb62 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -25,7 +25,7 @@ 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 +- Core: Implements core logics including monitoring overhead/accuracy 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. @@ -192,7 +192,7 @@ one page in the region is required to be checked. Thus= , for each ``sampling interval``, DAMON randomly picks one page in each region, waits for one ``sampling interval``, checks whether the page is accessed meanwhile, and increases the access frequency counter of the region if so. The counter is -called ``nr_regions`` of the region. Therefore, the monitoring overhead is +called ``nr_accesses`` of the region. Therefore, the monitoring overhead = is controllable by setting the number of regions. DAMON allows users to set = the minimum and the maximum number of regions for the trade-off. =20 --=20 2.39.2 From nobody Wed Dec 17 04:37:17 2025 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 2E2BB16F8F0; Mon, 1 Jul 2024 19:27:12 +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=1719862033; cv=none; b=Z6fDxmoaJVXX4AWMrkbYtqFLHNe1hgNyqzfFeDc44y3keZu6le34QnG6cYYvVZlupLP+hEtoMFsHlvB2FOjq7Jh75nMrL9BRKS8D2IpgOxJn3HC6CLGCrIj0ZoR7KveMOlkbEl8aG0ybmiTQuvFOqVn3FHL1+f+vyfzHy4tDsnQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719862033; c=relaxed/simple; bh=CGsIJNsF93bpCTcotGBiz8ijvYyjlCry6EOyClMIOWE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LGHbdxwcmg80bq+86DG3oZMU/2TZTB0aO6P7boXE+6cq4f/TtUTBHPcwH2ROSU+24dRjA8OrOqH00eiqVZvazSCqZkQooqXaHjL4RD9+Qe7fYM9Cz5Y5gsc7JcXrpYVDIbkCLQdVGWqvzWXoUOsh4wRh18Eb8j/J9FJbZqCT4rk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iJmT4/Kt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iJmT4/Kt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39829C32781; Mon, 1 Jul 2024 19:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719862032; bh=CGsIJNsF93bpCTcotGBiz8ijvYyjlCry6EOyClMIOWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iJmT4/KtExB1HchWvnqk0eBGAY7JJ7M88fEa6i1fAJPIiGKiejAY8ZPPmGCVMVd2a OWPDvZcD2QLnNIDMnqfH6mKpV7KDeAcu/3K8SJQKAJacI5VfXhghHEeRxJyoDmY7HK ufZQ9v2jitu9+6wlWtOTLHiKt1tV1YT5HAqxBn/j08M0tKlbgkTtMZ5JFs5Qvx4Zqz HYjrihwz2dO1oQIrhZts9riSaCpD6GHTnBU7j4GHxmsVM+NNIP17Ymot8b+8MuEUkF DMVElL3f517SFfSiwomSENdfObwdpxtUHU9Ta0FXm1Hd2qJzH6/Y6PbGZXAi8uSbcU yoZXSguI6zdCQ== 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/9] Docs/mm/damon/design: clarify regions merging operation Date: Mon, 1 Jul 2024 12:26:59 -0700 Message-Id: <20240701192706.51415-3-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240701192706.51415-1-sj@kernel.org> References: <20240701192706.51415-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" DAMON design document is not explaining how min_nr_regions limit is kept, and what happens if the number of regions exceeds max_nr_regions. Add more clarification for those. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 6beb245cbb62..fe08a3796e60 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -209,11 +209,18 @@ the data access pattern can be dynamically changed. = This will result in low monitoring quality. To keep the assumption as much as possible, DAMON adaptively merges and splits each region based on their access frequency. =20 -For each ``aggregation interval``, it compares the access frequencies of -adjacent regions and merges those if the frequency difference is small. T= hen, -after it reports and clears the aggregated access frequency of each region= , it -splits each region into two or three regions if the total number of regions -will not exceed the user-specified maximum number of regions after the spl= it. +For each ``aggregation interval``, it compares the access frequencies +(``nr_accesses``) of adjacent regions. If the difference is small, and if= the +sum of the two regions' sizes is smaller than the size of total regions di= vided +by the ``minimum number of regions``, DAMON merges the two regions. If the +resulting number of total regions is still higher than ``maximum number of +regions``, it repeats the merging with increasing access frequenceis diffe= rence +threshold until the upper-limit of the number of regions is met, or the +threshold becomes higher than possible maximum value (``aggregation interv= al`` +divided by ``sampling interval``). Then, after it reports and clears the +aggregated access frequency of each region, it splits each region into two= or +three regions if the total number of regions will not exceed the user-spec= ified +maximum number of regions after the split. =20 In this way, DAMON provides its best-effort quality and minimal overhead w= hile keeping the bounds users set for their trade-off. --=20 2.39.2 From nobody Wed Dec 17 04:37:17 2025 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 DF80F16FF44; Mon, 1 Jul 2024 19:27:13 +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=1719862034; cv=none; b=Y8ydFRjpKCSYPR7H+glYQF45e7SHiMRsD0DfqK3HH5OqUc56HaNST49ebhBAbhc/kJCkOYlMEX72dl3EWTZJNF+8MFcw5LYrQarvFQib5G2sqh7qJ4WLRo0QllHTP+PTA/rTTwe/3qzdvY5t0hRc+Mfm5MmpXY6DpIZlbDxfZjo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719862034; c=relaxed/simple; bh=xIHZ0L/qw5eQQs5fbReQPpk6P9pGxGMQqK3yOrF7MWg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=q1NelJ2uzubn/8u+R8fKxpAX8CpXxBggGxhkEx5oo+7MJYqN9iuF6Q+yRUbitMHASfTCe/nEGSKC/BpttMyh8lZuTgwGePLTPj4locGvJ+h0qG7iRR0ElEU9P7V2nEpkm6iwGMChuk2i48F/uYn/jVvL6dWrzz/BwN89FHRPmEs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O+nK9tiY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O+nK9tiY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5AC5C4AF0A; Mon, 1 Jul 2024 19:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719862033; bh=xIHZ0L/qw5eQQs5fbReQPpk6P9pGxGMQqK3yOrF7MWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O+nK9tiYcgMpX53+AWbsywu8xs749rQaWCssGXzuDSadnTFeYIMlrXu0ew3T9dogi IkTIfMtrF4gwrS8lz31uYJoiseCCJZBN6IK42mV5Ps+naC34CloIetMhyW+IIW0Tzm a3kLjxoOisBw1iI+iRFYDLkTJ9sfD7S87UQtjomfKCfkGG2nQKLRtrEbXiCK4xBjNB OxX6IPFsLg/kxTSojMTgp7r4eDXpkwob7xOWZAfAWVb9R2EKvi3clvf/8ukmnI4FaX /62gWPAvoqSIs4yka7Lz/BmMO2EbhNhKKwygKrTXIXoPsFmunFbrhZahPo/WoEyVKy clgLU8P1HYwIA== 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 3/9] Docs/admin-guide/mm/damon/start: add access pattern snapshot example Date: Mon, 1 Jul 2024 12:27:00 -0700 Message-Id: <20240701192706.51415-4-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240701192706.51415-1-sj@kernel.org> References: <20240701192706.51415-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" DAMON user-space tool (damo) provides access pattern snapshot feature, which is expected to be frequently used for real time access pattern analysis. The snapshot output is also showing what DAMON provides on its own, including the 'age' information. In contrast, the recorded access patterns, which is shown as an example usage on the quick start section, shows what users can make from what DAMON provided. It includes information that generated outside of DAMON and makes the 'age' concept bit unclear. Hence snapshot output is easier at understanding the raw realtime output of DAMON. Add the snapshot usage example on the quick start section. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/start.rst | 46 ++++++++++++++++++-- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/start.rst b/Documentation/a= dmin-guide/mm/damon/start.rst index 7aa0071ff1c3..054010a7f3d8 100644 --- a/Documentation/admin-guide/mm/damon/start.rst +++ b/Documentation/admin-guide/mm/damon/start.rst @@ -34,18 +34,56 @@ detail) of DAMON, you should ensure :doc:`sysfs ` is mounted. =20 =20 +Snapshot Data Access Patterns +=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 + +The commands below show the memory access pattern of a program at the mome= nt of +the execution. :: + + $ git clone https://github.com/sjp38/masim; cd masim; make + $ sudo damo start "./masim ./configs/stairs.cfg --quiet" + $ sudo ./damo show + 0 addr [85.541 TiB , 85.541 TiB ) (57.707 MiB ) access 0 % age 10= .400 s + 1 addr [85.541 TiB , 85.542 TiB ) (413.285 MiB) access 0 % age 11= .400 s + 2 addr [127.649 TiB , 127.649 TiB) (57.500 MiB ) access 0 % age 1.= 600 s + 3 addr [127.649 TiB , 127.649 TiB) (32.500 MiB ) access 0 % age 50= 0 ms + 4 addr [127.649 TiB , 127.649 TiB) (9.535 MiB ) access 100 % age 30= 0 ms + 5 addr [127.649 TiB , 127.649 TiB) (8.000 KiB ) access 60 % age 0 = ns + 6 addr [127.649 TiB , 127.649 TiB) (6.926 MiB ) access 0 % age 1 s + 7 addr [127.998 TiB , 127.998 TiB) (120.000 KiB) access 0 % age 11= .100 s + 8 addr [127.998 TiB , 127.998 TiB) (8.000 KiB ) access 40 % age 10= 0 ms + 9 addr [127.998 TiB , 127.998 TiB) (4.000 KiB ) access 0 % age 11= s + total size: 577.590 MiB + $ sudo ./damo stop + +The first command of the above example downloads and builds an artificial +memory access generator program called ``masim``. The second command asks= DAMO +to execute the artificial generator process start via the given command and +make DAMON monitors the generator process. The third command retrieves the +current snapshot of the monitored access pattern of the process from DAMON= and +shows the pattern in a human readable format. + +Each line of the output shows which virtual address range (``addr [XX, XX)= ``) +of the process is how frequently (``access XX %``) accessed for how long t= ime +(``age XX``). For example, the fifth region of ~9 MiB size is being most +frequently accessed for last 300 milliseconds. Finally, the fourth command +stops DAMON. + +Note that DAMON can monitor not only virtual address spaces but multiple t= ypes +of address spaces including the physical address space. + + Recording Data Access Patterns =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 commands below record the memory access patterns of a program and save= the monitoring results to a file. :: =20 - $ git clone https://github.com/sjp38/masim - $ cd masim; make; ./masim ./configs/zigzag.cfg & + $ ./masim ./configs/zigzag.cfg & $ sudo damo record -o damon.data $(pidof masim) =20 -The first two lines of the commands download an artificial memory access -generator program and run it in the background. The generator will repeat= edly +The line of the commands run the artificial memory access +generator program again. The generator will repeatedly access two 100 MiB sized memory regions one by one. You can substitute th= is with your real workload. The last line asks ``damo`` to record the access pattern in the ``damon.data`` file. --=20 2.39.2 From nobody Wed Dec 17 04:37:17 2025 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 55CAB171064; Mon, 1 Jul 2024 19:27:14 +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=1719862034; cv=none; b=aWCBPdZEqLD5aOJj4AmlmHk12WQ7m800JnnLow246iypsDK14ghguk1TSbLglXBbJSmboeFFrhJtoKjOqPoRD2YMtpfbubrKDiaIOcJMHQa5CI9gnpBjpuWAtWIfXMhyQRs0zB71dX4XGhgP/IxB9UhK80G37+UXgrH3D0bVF6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719862034; c=relaxed/simple; bh=KZDwSh9p7bgKe4AljWzfhXg05QxoAGNbBrR/qAsRtMM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cuR21GCRiZ9jPXmJfo60sfXayqjkCpNCkgnNCWnQgyEyCUyztBn20cV+jLl3EsdS62QsF1qB3N1iph1/zfhFNW31EoCEfzyryi9fP15FbDHossgZqZcwBnR0Wg55ojLax1dbe56FwIUfCfo7pcNgHaDqt518rYcnlDd7uaLN8go= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=acEBW/Cf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="acEBW/Cf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC91CC32786; Mon, 1 Jul 2024 19:27:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719862034; bh=KZDwSh9p7bgKe4AljWzfhXg05QxoAGNbBrR/qAsRtMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=acEBW/CfXYpxJ7Qs4Hki2GqyCzUUrPw4pqEv3Nlh57QhGTmKz28R5rbpX5MY2czmS q9DDEMMHeykfSZN5ecFSIgfCjSl8dMqFEawJFaG/X2Rx6omwQBB5WjyJB6jmvfaZhf vBg8NNBZijEK6ydJeaz7l7CgJyXoA/OF3cPuLhNrTf+Ioml4t7W/SsHyA0XiqZEqnu 8uQ/n/1WNwUKR2oGEji4eLpUyXjY92uWAdBU7b5ka9byhyJN/Pw+2ppDu/1R9GlcF9 v/kmZGNwOf62Pl3G8xNksQuc3hf3pcoHdh7Eg68z/t9/Ei9NrmTWc5vBBCNR3EXPVb qJf9xR92LDAbg== 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 4/9] Docs/mm/damon/design: add links from overall architecture to sections of details Date: Mon, 1 Jul 2024 12:27:01 -0700 Message-Id: <20240701192706.51415-5-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240701192706.51415-1-sj@kernel.org> References: <20240701192706.51415-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" DAMON design document briefly explains the overall layers architecture first, and then provides detailed explanations of each layer with dedicated sections. Letting readers go directly to the detailed sections for specific layers could help easy browsing of the not-very-short document. Add links from the overall summary to the sections of details. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index fe08a3796e60..991839200f80 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -22,13 +22,15 @@ Overall Architecture =20 DAMON subsystem is configured with three layers including =20 -- 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/accuracy 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. +- :ref:`Operations Set `: Implements fundamental + operations for DAMON that depends on the given monitoring target + address-space and available set of software/hardware primitives, +- :ref:`Core `: Implements core logics including monitor= ing + overhead/accuracy control and access-aware system operations on top of t= he + operations set layer, and +- :ref:`Modules `: Implements kernel modules for various + purposes that provides interfaces for the user space, on top of the core + layer. =20 =20 .. _damon_design_configurable_operations_set: @@ -140,6 +142,8 @@ conflict with the reclaim logic using ``PG_idle`` and `= `PG_young`` page flags, as Idle page tracking does. =20 =20 +.. _damon_core_logic: + Core Logics =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 @@ -512,6 +516,8 @@ interface, namely ``include/linux/damon.h``. Please re= fer to the API :doc:`document ` for details of the interface. =20 =20 +.. _damon_modules: + Modules =3D=3D=3D=3D=3D=3D=3D =20 --=20 2.39.2 From nobody Wed Dec 17 04:37:17 2025 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 6C8EA17164D; Mon, 1 Jul 2024 19:27:15 +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=1719862035; cv=none; b=EG2Z+fmV2y5513kj8geTT0yICeYvid1PtGP1vko8cU06jZo8BRcEqmh7NfvQZXN7VvV3YxIotXN7Jmltmp/XzPY859gzqmvm2bb3g/g1LJnA43DyQRE6UpGSfJl2ylTNImWJ/cFdJ8KubeNMlD8bsh9/qIE7eOymjnVyZeNIRTQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719862035; c=relaxed/simple; bh=rJ3ulbTwJLxSK96iYt4sNzwcCfFFXn8buJECo4dQpTY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Et4xpd+0HzaH0zm98Tkaqbz4Zf5iU6k83YUQEMyj6vl0SdnwXo87h0zDgwxSx4Fcg/QZji31Mys3Jegt0Pj4RPt9a17iYNbNPZFUUEAAdmRG0FPYYDehVH5f5tpPd7TVLJgUqj27O2cCeXuckTQRjOfSJ5qkyyrJ94TaWwqai3U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SqTrsWas; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SqTrsWas" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65E82C4AF0F; Mon, 1 Jul 2024 19:27:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719862034; bh=rJ3ulbTwJLxSK96iYt4sNzwcCfFFXn8buJECo4dQpTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SqTrsWasCO9YZQkdSM3QfYQxJG7JeXh+GPBfrnWwYuEEdvLsLiSebNb3Vh4KqQSq/ 9qow/oTaq2r0k/ubIKn3M0y2bStvbP2Qso3zi0Vaph0JxWnymFBzLpAMR/JzZhpLLB pBWXrLejrCSlPIc6OUeaVSlHVootzYshYHLiK5Mh1pnjpYt4ZTKK7rPG5FPnO1TbDI mGi/kniviA+TRPt6uqcyDG8A0KixgKd9/4Gw8obiLKK3feCcMjBeGaRZG2dkMKBHpu 6YSvOTk+G/13Qxe+GJE/+NR/RVCVhfypcxfcMgdsVaEH76ADaNYIJipHKgE5oPawLk D/qaDN0re7N1A== 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 5/9] Docs/mm/damon/design: move 'Configurable Operations Set' section into 'Operations Set Layer' section Date: Mon, 1 Jul 2024 12:27:02 -0700 Message-Id: <20240701192706.51415-6-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240701192706.51415-1-sj@kernel.org> References: <20240701192706.51415-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 'Configurable Operations Set' section is for providing a description of the pluggability of the operations set layer. Just after that, 'Operations Set Layer' section, which is dedicated for the entire things of the layer, follows. The layout is odd, and some descriptions are duplicated. Move 'Configurable Operations Set' section into 'Operations Set Layer' and re-write some of the detailed descriptions. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 47 +++++++++++++++---------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 991839200f80..f7029bc840ce 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -33,30 +33,6 @@ DAMON subsystem is configured with three layers including layer. =20 =20 -.. _damon_design_configurable_operations_set: - -Configurable Operations Set ---------------------------- - -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. - -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 supporting special optimized access -check primitives, those will be easily configurable. - - Programmable Modules -------------------- =20 @@ -72,11 +48,32 @@ 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 -The monitoring operations are defined in two parts: +.. _damon_design_configurable_operations_set: + +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. For example, below two operations for acc= ess +monitoring are address-space dependent. =20 1. Identification of the monitoring target address range for the address s= pace. 2. Access check of specific address range in the target space. =20 +DAMON consolidates these implementations in a layer called DAMON Operations +Set, and defines the interface between it and the upper layer. The upper = layer +is dedicated for DAMON's core logics including the mechanism for control o= f the +monitoring accruracy and the overhead. + +Hence, DAMON can easily be extended for any address space and/or available +hardware features by configuring the core logic to use the appropriate +operations set. If there is no available operations set for a given purpo= se, a +new operations set can be implemented following the interface between the +layers. + +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 +features, those will be easily configurable. + DAMON currently provides below three operation sets. Below two subsections describe how those work. =20 --=20 2.39.2 From nobody Wed Dec 17 04:37:17 2025 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 0216117166E; Mon, 1 Jul 2024 19:27:15 +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=1719862036; cv=none; b=Q1JnqhaDN564eQ56sIJ5OKbsl6cbFklhsGqDyrOnvASJ8EHvQK76tAX4zBfFHVdKxdLr8bgWWeuIVPKn2rrhoAaZOHcyKo4qfviIDTJFEzuvtVZjkZoJWFiHuAWKNDvKo1GrhfOKU4L80Wss21/KlGky5lgRVO5xtMFrk01UNGA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719862036; c=relaxed/simple; bh=kzj696pWU8DWR5Tm6fgirfTDKawz+VAhGd1JZg05h7s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UDKSrtXY0S45nvhI5vZ2rVSmKl9IeJXAsjH4sTg1icJ5N4HXYssxoUlvKLnKlhfZbAsbnpJVK6DbOcPcfhsU/ru6Dh6W/c+q4QHA+49Bu4keJLxJcs/8mYgJxJK1Xj89IFHfmoNyq4wA7mzRgekpzDBlQZpiFykyow9zwER4KHs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qMWN3CjS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qMWN3CjS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E5F8C4AF17; Mon, 1 Jul 2024 19:27:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719862035; bh=kzj696pWU8DWR5Tm6fgirfTDKawz+VAhGd1JZg05h7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qMWN3CjSlN++hAYJKb89nWhb7/2OGMc60CPhWXTVBX0IT6VL8SKe6i4JtH+4zaff1 md8OacaXkbRGlt3+A+dDiz7I0sMfGhXrzphZS5Od6U2+ifY/O1Ji57YaZiMDjiPK3G 3Zym7Ht0zxTrCqi1G+zdbDcheGVMFgaf0YBmo+ZaIFP0yiTIf9UWQHpR0MtquynpL5 +g30FP+UcFRlYUBcWk3Ij4f1Hm0CzGHb2P0iEAj9ma+6U6JXSQz/EMWmk5yY4CyGWw cPE8D401tb0IIYIGqXKFlGihjHWd0DdkgZyDAFnFxT/7T8+hmp4KbAhz2f5LfRX5N3 qQ6XqfTfRquuw== 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 6/9] Docs/mm/damon/design: Remove 'Programmable Modules' section in favor of 'Modules' section Date: Mon, 1 Jul 2024 12:27:03 -0700 Message-Id: <20240701192706.51415-7-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240701192706.51415-1-sj@kernel.org> References: <20240701192706.51415-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 'Programmable Modules' section provides high level descriptions of the DAMON API-based kernel modules layer. But 'Modules' section, which is at the end of the document, provides every detail about the layer including that of 'Programmable Modules' section. Since the brief summary of the layers at the beginning of the document has a link to the 'Modules' section, browsing to the section is not that difficult. Remove 'Programmable Modules' section in favor of 'Modules' section and reducing duplicates. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index f7029bc840ce..39e686c6862d 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -33,16 +33,6 @@ DAMON subsystem is configured with three layers including layer. =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. - - .. _damon_operations_set: =20 Operations Set Layer --=20 2.39.2 From nobody Wed Dec 17 04:37:17 2025 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 D2C4C171E6A; Mon, 1 Jul 2024 19:27:16 +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=1719862036; cv=none; b=SJ8zzOvOg5CdZnLp1/4xa3zT3ynkZh4eUyMN1u2QT2CfH03MVHHryyuGweacQZkV19gm2ZHoCLHhSjwCl1T8CC7BWW4Hq388YhWSueTAREl24gogYUcBruoU1FVKjQzVgML+E8DGdDc3giPuiFMCjXDe9pw549hbJPAS9B3bYbQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719862036; c=relaxed/simple; bh=ZnT7QNZiiuEpgT4tYIiBE2EHtfYlH/fKceMtToSKPPY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SLvaJEw7e5qP7CfHLyXg9Sn46zv7cphxkD7VH/l84LpGzH2npCXCScao/BfP+dl5QlJiJZQ5xUuQdt1RsqlmixBsBs7rLXgRGgAWpwsd91l+Sly8BokSv2SZGGKr1TdeSeHfWz7pYeJGE81zPn03yjfZhPmpWNs3TR4s9aeUHC4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pSsroV1U; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pSsroV1U" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA5A9C32781; Mon, 1 Jul 2024 19:27:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719862036; bh=ZnT7QNZiiuEpgT4tYIiBE2EHtfYlH/fKceMtToSKPPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pSsroV1UZFnezFKy/slb8Tj9vjjvce9bJP1JFpky/QnyvTug16ElPmCjL3vuaEElJ KBiRty1iMUl4AxQEwHmBZvyUoIv63L6CIVHl7ROUWYQeriAs71CzH08x+HURlSu2iD CtY7nQ6GBZGqEfD4ACjHSbSCvTkmdDdMYCObfGAn3y9qF35ky7tK3Wl8KmrEu5ThBF pr+3V3cFw8Nh3WcaWsD+bVvVK5rtsjxqZnWLQrr2LSRfARIc1dCZN9WeM5ufvS9VWa 5A7IFxxUNyTKPZkgFxBBk7V4tsanJHQwfcegLxhG0KN3GSNvUrDl3xjmwZtc99Tbg8 4MzdcmVCUVEbQ== 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 7/9] Docs/mm/damon/design: add links to sections of DAMON sysfs interface usage doc Date: Mon, 1 Jul 2024 12:27:04 -0700 Message-Id: <20240701192706.51415-8-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240701192706.51415-1-sj@kernel.org> References: <20240701192706.51415-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Readers of the design document would wonder how they can configure and use specific DAMON features. Add links to sections of DAMON sysfs interface usage document that provides the answers for easier browsing. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 39e686c6862d..89f5330e003f 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -16,6 +16,9 @@ called DAMON ``context``. DAMON executes each context wi= th a kernel thread called ``kdamond``. Multiple kdamonds could run in parallel, for different types of monitoring. =20 +To know how user-space can do the configurations and start/stop DAMON, ref= er to +:ref:`DAMON sysfs interface ` documentation. + =20 Overall Architecture =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -71,6 +74,10 @@ describe how those work. - fvaddr: Monitor fixed virtual address ranges - paddr: Monitor the physical address space of the system =20 +To know how user-space can do the configuration via :ref:`DAMON sysfs inte= rface +`, refer to :ref:`operations ` file part o= f the +documentation. + =20 .. _damon_design_vaddr_target_regions_construction: =20 @@ -143,6 +150,10 @@ monitoring attributes, ``sampling interval``, ``aggreg= ation interval``, ``update interval``, ``minimum number of regions``, and ``maximum number of regions``. =20 +To know how user-space can set the attributes via :ref:`DAMON sysfs interf= ace +`, refer to :ref:`monitoring_attrs ` +part of the documentation. + =20 Access Frequency Monitoring ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -246,6 +257,11 @@ and applies it to monitoring operations-related data s= tructures such as the abstracted monitoring target memory area only for each of a user-specified= time interval (``update interval``). =20 +User-space can get the monitoring results via DAMON sysfs interface and/or +tracepoints. For more details, please refer to the documentations for +:ref:`DAMOS tried regions ` and :ref:`tracepo= int`, +respectively. + =20 .. _damon_design_damos: =20 @@ -286,6 +302,10 @@ the access pattern of interest, and applies the user-d= esired operation actions to the regions, for every user-specified time interval called ``apply_interval``. =20 +To know how user-space can set ``apply_interval`` via :ref:`DAMON sysfs +interface `, refer to :ref:`apply_interval_us ` +part of the documentation. + =20 .. _damon_design_damos_action: =20 @@ -334,6 +354,10 @@ Applying the actions except ``stat`` to a region is co= nsidered as changing the region's characteristics. Hence, DAMOS resets the age of regions when any= such actions are applied to those. =20 +To know how user-space can set the action via :ref:`DAMON sysfs interface +`, refer to :ref:`action ` part of the +documentation. + =20 .. _damon_design_damos_access_pattern: =20 @@ -347,6 +371,10 @@ interest by setting minimum and maximum values of the = three properties. If 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 +To know how user-space can set the access pattern via :ref:`DAMON sysfs +interface `, refer to :ref:`access_pattern +` part of the documentation. + =20 .. _damon_design_damos_quotas: =20 @@ -366,6 +394,10 @@ 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. =20 +To know how user-space can set the basic quotas via :ref:`DAMON sysfs inte= rface +`, refer to :ref:`quotas ` part of the +documentation. + =20 .. _damon_design_damos_quotas_prioritization: =20 @@ -393,6 +425,10 @@ information to the underlying mechanism. Nevertheless= , how and even whether the weight will be respected are up to the underlying prioritization mecha= nism implementation. =20 +To know how user-space can set the prioritization weights via :ref:`DAMON = sysfs +interface `, refer to :ref:`weights ` part = of +the documentation. + =20 .. _damon_design_damos_quotas_auto_tuning: =20 @@ -422,6 +458,10 @@ Currently, two ``target_metric`` are provided. DAMOS does the measurement on its own, so only ``target_value`` need to = be set by users at the initial time. In other words, DAMOS does self-feedb= ack. =20 +To know how user-space can set the tuning goal metric, the target value, a= nd/or +the current value via :ref:`DAMON sysfs interface `, refe= r to +:ref:`quota goals ` part of the documentation. + =20 .. _damon_design_damos_watermarks: =20 @@ -444,6 +484,10 @@ is activated. If all schemes are deactivated by the w= atermarks, the monitoring is also deactivated. In this case, the DAMON worker thread only periodica= lly checks the watermarks and therefore incurs nearly zero overhead. =20 +To know how user-space can set the watermarks via :ref:`DAMON sysfs interf= ace +`, refer to :ref:`watermarks ` part of = the +documentation. + =20 .. _damon_design_damos_filters: =20 @@ -490,6 +534,10 @@ Below types of filters are currently supported. - Applied to pages that belonging to a given DAMON monitoring target. - Handled by the core logic. =20 +To know how user-space can set the watermarks via :ref:`DAMON sysfs interf= ace +`, refer to :ref:`filters ` part of the +documentation. + =20 Application Programming Interface --------------------------------- --=20 2.39.2 From nobody Wed Dec 17 04:37:17 2025 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 752D2172BAB; Mon, 1 Jul 2024 19:27:17 +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=1719862037; cv=none; b=HaZxmNg3S7oL9/FePB2/95a4H/x0jNtEttFpEwv1VbyxiuRVqnoRLFmKVKVWqI64oGlPlMJH32ShgQ7PQwxEYoRpkVd9RP7PmBir1J4wzHmJAw1AZJO5R8qrnlqlkCw4l/YYQBjw/3nqytESyt7oFJaVZxd5mtUX4qT6h59uI5w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719862037; c=relaxed/simple; bh=W9d4cUx1EjXG3O2nC/ytqNez6Roq0dChgJMH8XJ7CE8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YFsDXDJoirRyPZhqPTJRKK9q4SGU/NJoPE1UTEOltkUuiaeiZerl2Gb6UXd1SmvDCUQXQh16rY4F75QIxEkKQqvrwmn5DA0bbqTls/g0lLtNql46fZzaIJUs7BRN/2LJgzJwZEFlbI5Ak22x6oQdRsnFZXE+ziUvh3vmejsxPPk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IXU6KryR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IXU6KryR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9226FC4AF0D; Mon, 1 Jul 2024 19:27:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719862037; bh=W9d4cUx1EjXG3O2nC/ytqNez6Roq0dChgJMH8XJ7CE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IXU6KryR88jDAsOwngkduDOqIYRUMZ3Zx6gSiN32pgbA9QsG3NtQ71mfMPlhVZpsV 3DTrttmY6WafRHkIIVnDhir3Nw3hQa7//04K5Ucxf92WnBeG92/BlbHKEj+NWfv0ke nH58B14RusmqUVBu8o1UA89LsYIs441aD8Vk3PiyWsW5uegD7pPUWS4I0pfAdV5JE3 EFD+zqjVWjGWOXksvVlKhX4IRRnygeY3kA/qu8orOL3eFt1A0Bm2uxMJ3vwReE8ZBS mb68L1pa8dImiQoboeisyLrVx1jQ5NAIDEUt34bVZwS7LLEu4gPhozkKAyCLKuQDWg jtvxepdW0s4Bg== 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 8/9] Docs/mm/damon/index: add links to design Date: Mon, 1 Jul 2024 12:27:05 -0700 Message-Id: <20240701192706.51415-9-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240701192706.51415-1-sj@kernel.org> References: <20240701192706.51415-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" DAMON subsystem documents index page provides a short intro of DAMON core concepts. Add links to sections of the design document to let users easily browse to the details. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 1 + Documentation/mm/damon/index.rst | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 89f5330e003f..8730c246ceaa 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -141,6 +141,7 @@ as Idle page tracking does. Core Logics =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 +.. _damon_design_monitoring: =20 Monitoring ---------- diff --git a/Documentation/mm/damon/index.rst b/Documentation/mm/damon/inde= x.rst index 5e0a50583500..3d3b345d8889 100644 --- a/Documentation/mm/damon/index.rst +++ b/Documentation/mm/damon/index.rst @@ -6,7 +6,7 @@ DAMON: Data Access MONitor =20 DAMON is a Linux kernel subsystem that provides a framework for data access monitoring and the monitoring results based system operations. The core -monitoring mechanisms of DAMON (refer to :doc:`design` for the detail) mak= e it +monitoring :ref:`mechanisms ` of DAMON make it =20 - *accurate* (the monitoring output is useful enough for DRAM level memory management; It might not appropriate for CPU Cache levels, though), @@ -21,10 +21,11 @@ users who have special information about their workload= s can write personalized applications for better understanding and optimizations of their workloads= and systems. =20 -For easier development of such systems, DAMON provides a feature called DA= MOS -(DAMon-based Operation Schemes) in addition to the monitoring. Using the -feature, DAMON users in both kernel and user spaces can do access-aware sy= stem -operations with no code but simple configurations. +For easier development of such systems, DAMON provides a feature called +:ref:`DAMOS ` (DAMon-based Operation Schemes) in addit= ion +to the monitoring. Using the feature, DAMON users in both kernel and user +spaces can do access-aware system operations with no code but simple +configurations. =20 .. toctree:: :maxdepth: 2 --=20 2.39.2 From nobody Wed Dec 17 04:37:17 2025 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 E0195172BD1; Mon, 1 Jul 2024 19:27:17 +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=1719862038; cv=none; b=VODGaWEuDdCX+JRqS0gf0r8dun5Wpfouzy1HjNiDDkOEEl7B8GoHpfDS4Zb4ANFpNejhW5sjCBe4I3nQiXeq6GphWxyZ/3xacQdUzgHnFZ7+ba1cpxfjzncGwbOnbm1xMKDv2EywZN9jC448kkAaN1GOY9+toHxgCivV6zSpGZs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719862038; c=relaxed/simple; bh=fBlkxk1Ff29Zv5hf2sNJnmiHJF0MltvzTSJLNhDvsG8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=C1LCS26pfOteAuIrFxPbjbCFXYyN7nGti7dHfZhwSwZxDjkNlTvX5Qszb1AvXSEZfXn3ZSM5JJHuTTwaXP4yjPeHEwtFsz4yQ9Ci4cQRz4M1vCZZsjfNSyQz++au13K0O8IpW8V4SFtO/TVp41oD9hC7T59jeIA3wr8X4w5aPuU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X4uyulKb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="X4uyulKb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BA6FC32786; Mon, 1 Jul 2024 19:27:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719862037; bh=fBlkxk1Ff29Zv5hf2sNJnmiHJF0MltvzTSJLNhDvsG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X4uyulKbdcl37BYLf/rxxpfmLRRiHxgo0DdJC/AznGxFaPaD2j5tC1707zu7MB4m+ oJHVeSBr7Hsz/iQ3j/bCS+ZvrNDhcRNnbYDp38oh1BejNsY6D2hqBEd7NFK9vT7oPL F9tXsQ2/A3l7gcSZ0M8xHvwtA/eaBmHnRDfcG8tEVoGMwvD/AvmZpVT3QDVEMiZ+1r NTLTFMinIq0OI2PmAO8xdUtoayV+W+xeFoncTB63jXwm2TR/4ALWSu+g6IBJW38x1P 4iPYzXgQ/QfldH4VQCg/4E/SXPmzn6KWDXXGiOWQGfl6aYfF94MwLNs97Pu3CFNO6b AFaxzonaM27Cg== 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 9/9] Docs/mm/damon/index: add links to admin-guide doc Date: Mon, 1 Jul 2024 12:27:06 -0700 Message-Id: <20240701192706.51415-10-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240701192706.51415-1-sj@kernel.org> References: <20240701192706.51415-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Readers of DAMON subsystem documents index would want to further learn how they can use DAMON from the user-space. Add the link to the admin guide. Signed-off-by: SeongJae Park --- Documentation/mm/damon/index.rst | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Documentation/mm/damon/index.rst b/Documentation/mm/damon/inde= x.rst index 3d3b345d8889..dafd6d028924 100644 --- a/Documentation/mm/damon/index.rst +++ b/Documentation/mm/damon/index.rst @@ -16,16 +16,16 @@ monitoring :ref:`mechanisms ` = of DAMON make it of the size of target workloads). =20 Using this framework, therefore, the kernel can operate system in an -access-aware fashion. Because the features are also exposed to the user s= pace, -users who have special information about their workloads can write persona= lized -applications for better understanding and optimizations of their workloads= and -systems. +access-aware fashion. Because the features are also exposed to the :doc:`= user +space `, users who have special information a= bout +their workloads can write personalized applications for better understandi= ng +and optimizations of their workloads and systems. =20 For easier development of such systems, DAMON provides a feature called :ref:`DAMOS ` (DAMon-based Operation Schemes) in addit= ion -to the monitoring. Using the feature, DAMON users in both kernel and user -spaces can do access-aware system operations with no code but simple -configurations. +to the monitoring. Using the feature, DAMON users in both kernel and :doc= :`user +spaces ` can do access-aware system operations +with no code but simple configurations. =20 .. toctree:: :maxdepth: 2 @@ -34,3 +34,6 @@ configurations. design api maintainer-profile + +To utilize and control DAMON from the user-space, please refer to the +administration :doc:`guide `. --=20 2.39.2