From nobody Mon Feb 9 04:28:53 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 BB41EEB64D7 for ; Fri, 16 Jun 2023 19:21:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345060AbjFPTVq (ORCPT ); Fri, 16 Jun 2023 15:21:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345417AbjFPTVY (ORCPT ); Fri, 16 Jun 2023 15:21:24 -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 515235256; Fri, 16 Jun 2023 12:19:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5B83E637D2; Fri, 16 Jun 2023 19:17:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36B0FC433C8; Fri, 16 Jun 2023 19:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686943068; bh=l86JWMdvVZwYcsvalUMuaAJbJetoG2ebBMyTen7o1Uk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qr2d0sNYjVXHU2h2cqGjllyRexevn0t+autu/4Fqlk1gSHpY9elRfUlnnfCb22CC/ RK82KqUj8pDaUCmh8ryWEwzBGIbYN/6c2k397K0rPqsiIJVrhl8bRsXwM+Q78JRv7U 269xagijYdqtqDx/F8VEPtQGJpO3G9VdcRPTHE7by+L7mas3ZcuFDLHQ/99JVsSxyz 1Kn6h1liPOopyFtjUysuO9LFXG0UUSTxBzLoEt+If/QMY8avmU1cTkUNdeHFmSfZeS EpLAqipTwBQROZWN92bRjNy+hxtQe1Alu/SJN9XXXeudr8b93h5JkbgExk1uMLmDFB MjbTIMb3ILl1g== 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/7] Docs/mm/damon/design: document 'age' of region Date: Fri, 16 Jun 2023 19:17:36 +0000 Message-Id: <20230616191742.87531-2-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230616191742.87531-1-sj@kernel.org> References: <20230616191742.87531-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 'age' of each region in DAMON monitoring results is an important concept for both monitoring part and DAMOS. And DAMOS section of the design document is mentioning it. However, the age itself is not explained in the document. Add a section for that. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index da110e89cab4..a98af99bb705 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -190,6 +190,20 @@ In this way, DAMON provides its best-effort quality an= d minimal overhead while keeping the bounds users set for their trade-off. =20 =20 +Age Tracking +~~~~~~~~~~~~ + +By analyzing the monitoring results, users can also find how long the curr= ent +access pattern of a region has maintained. That could be used for good +understanding of the access pattern. For example, page placement algorithm +utilizing both the frequency and the recency could be implemented using th= at. +To make such access pattern maintained period analysis easier, DAMON maint= ains +yet another counter called ``age`` in each region. For each ``aggregation +interval``, DAMON checks if the region's size and access frequency +(``nr_accesses``) has significantly changed. If so, the counter is reset = to +zero. Otherwise, the counter is increased. + + Dynamic Target Space Updates Handling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =20 --=20 2.25.1 From nobody Mon Feb 9 04:28:53 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 78BBAEB64D7 for ; Fri, 16 Jun 2023 19:21:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345667AbjFPTVy (ORCPT ); Fri, 16 Jun 2023 15:21:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345460AbjFPTVY (ORCPT ); Fri, 16 Jun 2023 15:21:24 -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 882C7525C; Fri, 16 Jun 2023 12:19:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 17DCE63E91; Fri, 16 Jun 2023 19:17:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00E20C433C0; Fri, 16 Jun 2023 19:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686943069; bh=LvC4YT4/e0KgspEdK+7PadxzOaV+ZKDN40FmhrIY1TE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pjRyPXBjPdmD/CCyo3c/TOJEl8Pc/wVwxfP/HY+a9sa6wUtE1ECgVtVOC0x4Dm/EZ /FBoIRXKO64a0/wO29ZO4g1VWHNl4FtGc08wRZkiCOXa9vgfri7swZffPkGk1mlY4s 2bzaL1IeFZdWGH2AtwoG651fSafZC15/aa/H/OTI90JKO07q82eEgVXnqkwvIMkwyx /n8msXEZh2z8+ptNjDMD5vJQRYUOEhjW93jFNuQbPZ9asQRgRXDBuSXDo5EaQsSGQ4 l2v9YABAJtr+MjpYWV0t4y8pIOqxzmot/AkRtdU2KHUxTWA3rIuQEx092Tlf8UZpY4 nRF+N3RE8K5Ww== 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/7] Docs/admin-guide/mm/damon/start: update DAMOS example command Date: Fri, 16 Jun 2023 19:17:37 +0000 Message-Id: <20230616191742.87531-3-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230616191742.87531-1-sj@kernel.org> References: <20230616191742.87531-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 user-space tool, damo, has deprecated[1] its old DAMOS schemes specification format. However, an example of DAMON documentation is still using it. Update the example to use one of the alternative options. [1] https://github.com/awslabs/damo/commit/e9950ae68f6c Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/start.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/start.rst b/Documentation/a= dmin-guide/mm/damon/start.rst index 9f88afc734da..7aa0071ff1c3 100644 --- a/Documentation/admin-guide/mm/damon/start.rst +++ b/Documentation/admin-guide/mm/damon/start.rst @@ -119,9 +119,9 @@ set size has chronologically changed.:: Data Access Pattern Aware Memory Management =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 =20 -Below three commands make every memory region of size >=3D4K that doesn't -accessed for >=3D60 seconds in your workload to be swapped out. :: +Below command makes every memory region of size >=3D4K that has not access= ed for +>=3D60 seconds in your workload to be swapped out. :: =20 - $ echo "#min-size max-size min-acc max-acc min-age max-age action" > t= est_scheme - $ echo "4K max 0 0 60s max pageout" >>= test_scheme - $ damo schemes -c test_scheme + $ sudo damo schemes --damos_access_rate 0 0 --damos_sz_region 4K max \ + --damos_age 60s max --damos_action pageout \ + --=20 2.25.1 From nobody Mon Feb 9 04:28:53 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 23098EB64D7 for ; Fri, 16 Jun 2023 19:22:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345818AbjFPTV4 (ORCPT ); Fri, 16 Jun 2023 15:21:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345770AbjFPTVZ (ORCPT ); Fri, 16 Jun 2023 15:21: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 BD4E6525F; Fri, 16 Jun 2023 12:19:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C3D4363EB1; Fri, 16 Jun 2023 19:17:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B05F0C433AD; Fri, 16 Jun 2023 19:17:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686943070; bh=/PqkZzi3PmcfmmQ2ShVZNSPJIc3ayquVqki2elLWBA8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JYrW9cm+OeRlKwfHbXjV7uGo3r6/53L5aXiZpIgz9CbhooZv0svdwy3KG+3gjDviP g600JjZC6WGUBJ8Ao8i1vOS2ef8fe5HL8Lo09xnPJqvawnLxGJ0BNLOdtS2DU8XbFO rqsM6NTwxkupSgRKVY5wiICRb1Xm/+peHg+PaUjmquV+CCNy1GffAX0B36347W3rEt tkj2wQOlIH3EAfsXY2L5KW01rNcwYCBJ1DrsIa8IR8iB9m6goXGF9JtfflAE03appl 8ESApdmB5BaL1YQ73WzP13I0NNPwX5dIBNRYbPkB5AZ2NX3r2rQJFZxQRBzVvRigjw 94cP3Y9asSwhg== 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/7] Docs/admin-guide/mm/damon/usage: fix typos in references and commas Date: Fri, 16 Jun 2023 19:17:38 +0000 Message-Id: <20230616191742.87531-4-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230616191742.87531-1-sj@kernel.org> References: <20230616191742.87531-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 typos including a unnecessary comma and incomplete ':ref:' keywords. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/a= dmin-guide/mm/damon/usage.rst index 9b823fec974d..d2435dcc22f4 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -139,7 +139,7 @@ scheme of the kdamond. Writing ``clear_schemes_tried_r= egions`` to ``state`` file clears the DAMON-based operating scheme action tried regions director= y for each DAMON-based operation scheme of the kdamond. For details of the DAMON-based operation scheme action tried regions directory, please refer = to -:ref:tried_regions section `. +:ref:`tried_regions section `. =20 If the state is ``on``, reading ``pid`` shows the pid of the kdamond threa= d. =20 @@ -282,7 +282,7 @@ memory regions having specific access pattern of the in= terest. The keywords that can be written to and read from the file and their meaning are as bel= ow. =20 Note that support of each action depends on the running DAMON operations s= et -`implementation `. +:ref:`implementation `. =20 - ``willneed``: Call ``madvise()`` for the region with ``MADV_WILLNEED``. Supported by ``vaddr`` and ``fvaddr`` operations set. @@ -432,8 +432,7 @@ starting from ``0`` under this directory. Each directo= ry contains files exposing detailed information about each of the memory region that the corresponding scheme's ``action`` has tried to be applied under this direc= tory, during next :ref:`aggregation interval `. The -information includes address range, ``nr_accesses``, , and ``age`` of the -region. +information includes address range, ``nr_accesses``, and ``age`` of the re= gion. =20 The directories will be removed when another special keyword, ``clear_schemes_tried_regions``, is written to the relevant --=20 2.25.1 From nobody Mon Feb 9 04:28:53 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 6247DEB64D8 for ; Fri, 16 Jun 2023 19:22:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346199AbjFPTWy (ORCPT ); Fri, 16 Jun 2023 15:22:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346134AbjFPTWj (ORCPT ); Fri, 16 Jun 2023 15:22:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16913448F; Fri, 16 Jun 2023 12:20:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7B84163CB8; Fri, 16 Jun 2023 19:17:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C470C433C9; Fri, 16 Jun 2023 19:17:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686943070; bh=aJtinuQE5hnsMJprwvOnjBhsLDj5P+RjjV73H7HUq2A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NxTPy+3OTB1zZ2p0KOifG1NKvCKG0RPDaSG85QRPUoigBNHlTUZu4IbuDIX1BN/r6 0+nWVeeA4PP8KxacmnmdoMm28huF1hDRuC3xDPquhxJ9hgJhhpngED2RmZ6zH6kEyu vOm2l99AeV0gY6VxJKIc+q6c86nnHp8VLuRBybH05MJ14lf4M3Ud0Tplt+AhqMnPhH W71TKq1CqbVD8hCBBNAwHmx02Yp1kwjtV/BEnhE2hT4VQM2Wr+OsPXz5lUtKzPkY+A xFXbHLwoDdVbARv4s+MCH8i6Ft0nXc8fQ5morIYwX0LYBsCcf98vRU6AC9zqngPjCv nzMOLdQ3vE3iQ== 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/7] Docs/admin-guide/mm/damon/usage: remove unnecessary sentences about supported address spaces Date: Fri, 16 Jun 2023 19:17:39 +0000 Message-Id: <20230616191742.87531-5-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230616191742.87531-1-sj@kernel.org> References: <20230616191742.87531-1-sj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Brief explanation of DAMON user space tool and sysfs interface are unnecessarily and repeatedly mentioning the list of address spaces that DAMON is supporting. Remove those. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/a= dmin-guide/mm/damon/usage.rst index d2435dcc22f4..82a79838a47d 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -10,9 +10,8 @@ DAMON provides below interfaces for different users. `This `_ is for privileged people such = as system administrators who want a just-working human-friendly interface. Using this, users can use the DAMON=E2=80=99s major features in a human-= friendly way. - It may not be highly tuned for special cases, though. It supports both - virtual and physical address spaces monitoring. For more detail, please - refer to its `usage document + It may not be highly tuned for special cases, though. For more detail, + please refer to its `usage document `_. - *sysfs interface.* :ref:`This ` is for privileged user space programmers w= ho @@ -20,10 +19,9 @@ DAMON provides below interfaces for different users. features by reading from and writing to special sysfs files. Therefore, you can write and use your personalized DAMON sysfs wrapper programs that reads/writes the sysfs files instead of you. The `DAMON user space tool - `_ is one example of such programs. It - supports both virtual and physical address spaces monitoring. Note that= this - interface provides only simple :ref:`statistics ` for the - monitoring results. For detailed monitoring results, DAMON provides a + `_ is one example of such programs. No= te + that this interface provides only simple :ref:`statistics `= for + the monitoring results. For detailed monitoring results, DAMON provides= a :ref:`tracepoint `. - *debugfs interface. (DEPRECATED!)* :ref:`This ` is almost identical to :ref:`sysfs inter= face --=20 2.25.1 From nobody Mon Feb 9 04:28:53 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 E84C6EB64D7 for ; Fri, 16 Jun 2023 19:23:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346242AbjFPTXB (ORCPT ); Fri, 16 Jun 2023 15:23:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbjFPTWo (ORCPT ); Fri, 16 Jun 2023 15:22:44 -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 92AA744A3; Fri, 16 Jun 2023 12:20:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 49C8363E4F; Fri, 16 Jun 2023 19:17:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27FFEC433CB; Fri, 16 Jun 2023 19:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686943071; bh=f3HOe9/kZR2u+JAC7ZFka5WaxvMhj+FaHkWQpsoLpnE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=paP/cMrrN2YC1qI+2IOL6lzfXW+Cgu9GTDAFTYdWea8Vi9SeJGajGut/HE8gpTI1G YPSdaHIqP/xEAjnvjXDzgDU7D82IMUJGXx8HhmVYuSXRfm7bP3Ec1KgfFqvXSgR1QJ NNMxIA79qpBl4DsDGX6d0dF5bWvxj+IjySwODmHLwaJTKDIOY4j/QV2/4SSNyUGrii 0FxdXjaDU/4yVD2D8dQ8cy8Lvw0xpXDuDSlxj4MUFEzG+fcnEI5J2GsaueAGO24eRA SlZ4VI+1u4Dfkw+hjNHxjGUfSwNalwcnN6/BsiETA6RsnAPLVcYAoGp0kKpCY69N7J c3HDybrTKMGmA== 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/7] Docs/admin-guide/mm/damon/usage: link design document for DAMOS Date: Fri, 16 Jun 2023 19:17:40 +0000 Message-Id: <20230616191742.87531-6-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230616191742.87531-1-sj@kernel.org> References: <20230616191742.87531-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 background and concept of DAMOS is redundantly documented, in the design document and the usage document. Replace the duplicated ones in usage document with links to the design document. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 104 +++++++------------ Documentation/mm/damon/design.rst | 14 +++ 2 files changed, 51 insertions(+), 67 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/a= dmin-guide/mm/damon/usage.rst index 82a79838a47d..ea6a5dc8930e 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -257,12 +257,9 @@ be equal or smaller than ``start`` of directory ``N+1`= `. contexts//schemes/ --------------------- =20 -For usual DAMON-based data access aware memory management optimizations, u= sers -would normally want the system to apply a memory management action to a me= mory -region of a specific access pattern. DAMON receives such formalized opera= tion -schemes from the user and applies those to the target memory regions. Use= rs -can get and set the schemes by reading from and writing to files under this -directory. +The directory for DAMON-based Operation Schemes (:ref:`DAMOS +`). Users can get and set the schemes by reading from= and +writing to files under this directory. =20 In the beginning, this directory has only one file, ``nr_schemes``. Writi= ng a number (``N``) to the file creates the number of child directories named `= `0`` @@ -275,9 +272,9 @@ In each scheme directory, five directories (``access_pa= ttern``, ``quotas``, ``watermarks``, ``filters``, ``stats``, and ``tried_regions``) and one file (``action``) exist. =20 -The ``action`` file is for setting and getting what action you want to app= ly to -memory regions having specific access pattern of the interest. The keywor= ds -that can be written to and read from the file and their meaning are as bel= ow. +The ``action`` file is for setting and getting the scheme's :ref:`action +`. The keywords that can be written to and read +from the file and their meaning are as below. =20 Note that support of each action depends on the running DAMON operations s= et :ref:`implementation `. @@ -302,10 +299,8 @@ Note that support of each action depends on the runnin= g DAMON operations set schemes//access_pattern/ --------------------------- =20 -The target access pattern of each DAMON-based operation scheme is construc= ted -with three ranges including the size of the region in bytes, number of -monitored accesses per aggregate interval, and number of aggregated interv= als -for the age of the region. +The directory for the target access :ref:`pattern +` of the given DAMON-based operation sc= heme. =20 Under the ``access_pattern`` directory, three directories (``sz``, ``nr_accesses``, and ``age``) each having two files (``min`` and ``max``) @@ -316,18 +311,8 @@ to and reading from the ``min`` and ``max`` files unde= r ``sz``, schemes//quotas/ ------------------- =20 -Optimal ``target access pattern`` for each ``action`` is workload dependen= t, so -not easy to find. Worse yet, setting a scheme of some action too aggressi= ve -can cause severe overhead. To avoid such overhead, users can limit time a= nd -size quota for each scheme. In detail, users can ask DAMON to try to use = only -up to specific time (``time quota``) for applying the action, and to apply= the -action to only up to specific amount (``size quota``) of memory regions ha= ving -the target access pattern within a given time interval (``reset interval``= ). - -When the quota limit is expected to be exceeded, DAMON prioritizes found m= emory -regions of the ``target access pattern`` based on their size, access frequ= ency, -and age. For personalized prioritization, users can set the weights for t= he -three properties. +The directory for the :ref:`quotas ` of the giv= en +DAMON-based operation scheme. =20 Under ``quotas`` directory, three files (``ms``, ``bytes``, ``reset_interval_ms``) and one directory (``weights``) having three files @@ -335,23 +320,20 @@ Under ``quotas`` directory, three files (``ms``, ``by= tes``, =20 You can set the ``time quota`` in milliseconds, ``size quota`` in bytes, a= nd ``reset interval`` in milliseconds by writing the values to the three file= s, -respectively. You can also set the prioritization weights for size, access -frequency, and age in per-thousand unit by writing the values to the three -files under the ``weights`` directory. +respectively. You can also set the :ref:`prioritization weights +` for size, access frequency, an= d age +in per-thousand unit by writing the values to the three files under the +``weights`` directory. =20 schemes//watermarks/ ----------------------- =20 -To allow easy activation and deactivation of each scheme based on system -status, DAMON provides a feature called watermarks. The feature receives = five -values called ``metric``, ``interval``, ``high``, ``mid``, and ``low``. T= he -``metric`` is the system metric such as free memory ratio that can be meas= ured. -If the metric value of the system is higher than the value in ``high`` or = lower -than ``low`` at the memoent, the scheme is deactivated. If the value is l= ower -than ``mid``, the scheme is activated. +The directory for the :ref:`watermarks ` of= the +given DAMON-based operation scheme. =20 Under the watermarks directory, five files (``metric``, ``interval_us``, -``high``, ``mid``, and ``low``) for setting each value exist. You can set= and +``high``, ``mid``, and ``low``) for setting the metric, the time interval +between check of the metric, and the three watermarks exist. You can set = and get the five values by writing to the files, respectively. =20 Keywords and meanings of those that can be written to the ``metric`` file = are @@ -365,12 +347,8 @@ The ``interval`` should written in microseconds unit. schemes//filters/ -------------------- =20 -Users could know something more than the kernel for specific types of memo= ry. -In the case, users could do their own management for the memory and hence -doesn't want DAMOS bothers that. Users could limit DAMOS by setting the a= ccess -pattern of the scheme and/or the monitoring regions for the purpose, but t= hat -can be inefficient in some cases. In such cases, users could set non-acce= ss -pattern driven filters using files in this directory. +The directory for the :ref:`filters ` of the g= iven +DAMON-based operation scheme. =20 In the beginning, this directory has only one file, ``nr_filters``. Writi= ng a number (``N``) to the file creates the number of child directories named `= `0`` @@ -597,15 +575,10 @@ update. Schemes ------- =20 -For usual DAMON-based data access aware memory management optimizations, u= sers -would simply want the system to apply a memory management action to a memo= ry -region of a specific access pattern. DAMON receives such formalized opera= tion -schemes from the user and applies those to the target processes. - -Users can get and set the schemes by reading from and writing to ``schemes= `` -debugfs file. Reading the file also shows the statistics of each scheme. = To -the file, each of the schemes should be represented in each line in below -form:: +Users can get and set the DAMON-based operation :ref:`schemes +` by reading from and writing to ``schemes`` debugfs f= ile. +Reading the file also shows the statistics of each scheme. To the file, e= ach +of the schemes should be represented in each line in below form:: =20 =20 @@ -614,8 +587,9 @@ You can disable schemes by simply writing an empty stri= ng to the file. Target Access Pattern ~~~~~~~~~~~~~~~~~~~~~ =20 -The ```` is constructed with three ranges in below -form:: +The target access :ref:`pattern ` of the +scheme. The ```` is constructed with three ranges = in +below form:: =20 min-size max-size min-acc max-acc min-age max-age =20 @@ -628,9 +602,9 @@ closed interval. Action ~~~~~~ =20 -The ```` is a predefined integer for memory management actions, wh= ich -DAMON will apply to the regions having the target access pattern. The -supported numbers and their meanings are as below. +The ```` is a predefined integer for memory management :ref:`actio= ns +`. The supported numbers and their meanings ar= e as +below. =20 - 0: Call ``madvise()`` for the region with ``MADV_WILLNEED``. Ignored if ``target`` is ``paddr``. @@ -646,10 +620,8 @@ supported numbers and their meanings are as below. Quota ~~~~~ =20 -Optimal ``target access pattern`` for each ``action`` is workload dependen= t, so -not easy to find. Worse yet, setting a scheme of some action too aggressi= ve -can cause severe overhead. To avoid such overhead, users can limit time a= nd -size quota for the scheme via the ```` in below form:: +Users can set the :ref:`quotas ` of the given s= cheme +via the ```` in below form:: =20 =20 @@ -659,19 +631,17 @@ the action to memory regions of the ``target access p= attern`` within the ```` bytes of memory regions within the ````. Setting= both ```` and ```` zero disables the quota limits. =20 -When the quota limit is expected to be exceeded, DAMON prioritizes found m= emory -regions of the ``target access pattern`` based on their size, access frequ= ency, -and age. For personalized prioritization, users can set the weights for t= he -three properties in ```` in below form:: +For the :ref:`prioritization `, = users +can set the weights for the three properties in ```` in = below +form:: =20 =20 Watermarks ~~~~~~~~~~ =20 -Some schemes would need to run based on current value of the system's spec= ific -metrics like free memory ratio. For such cases, users can specify waterma= rks -for the condition.:: +Users can specify :ref:`watermarks ` of the +given scheme via ```` in below form:: =20 =20 diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index a98af99bb705..4bfdf1d30c4a 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -218,6 +218,8 @@ abstracted monitoring target memory area only for each = of a user-specified time interval (``update interval``). =20 =20 +.. _damon_design_damos: + Operation Schemes ----------------- =20 @@ -255,6 +257,8 @@ the access pattern of interest, and applies the user-de= sired operation actions to the regions as soon as found. =20 =20 +.. _damon_design_damos_action: + Operation Action ~~~~~~~~~~~~~~~~ =20 @@ -277,6 +281,8 @@ characteristics. Hence, DAMOS resets the age of region= s when an action is applied to those. =20 =20 +.. _damon_design_damos_access_pattern: + Target Access Pattern ~~~~~~~~~~~~~~~~~~~~~ =20 @@ -288,6 +294,8 @@ region's three properties are in the ranges, DAMOS clas= sifies it as one of the regions that the scheme is having an interest in. =20 =20 +.. _damon_design_damos_quotas: + Quotas ~~~~~~ =20 @@ -305,6 +313,8 @@ 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 =20 +.. _damon_design_damos_quotas_prioritization: + Prioritization ^^^^^^^^^^^^^^ =20 @@ -330,6 +340,8 @@ the weight will be respected are up to the underlying p= rioritization mechanism implementation. =20 =20 +.. _damon_design_damos_watermarks: + Watermarks ~~~~~~~~~~ =20 @@ -350,6 +362,8 @@ is also deactivated. In this case, the DAMON worker th= read only periodically checks the watermarks and therefore incurs nearly zero overhead. =20 =20 +.. _damon_design_damos_filters: + Filters ~~~~~~~ =20 --=20 2.25.1 From nobody Mon Feb 9 04:28:53 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 51498EB64D7 for ; Fri, 16 Jun 2023 19:22:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232884AbjFPTW6 (ORCPT ); Fri, 16 Jun 2023 15:22:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346148AbjFPTWk (ORCPT ); Fri, 16 Jun 2023 15:22:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5FEB4492; Fri, 16 Jun 2023 12:20:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0180C63E6A; Fri, 16 Jun 2023 19:17:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5EFFC433CC; Fri, 16 Jun 2023 19:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686943072; bh=NSJWB8qz10yOL/bHuEJZ9E4zJc8xME6g7oYO5L7FpU4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dub7L+lmxmLwpcJQU7FPIsUOXY6YxCJpUw2WsTuGV7MavLJn4qkm4yw+R3detHRCK wZRKPnZJnsWLDYuxH6d97h19JH1JwPJ3CtrXoSXXWyw7u6uxJv0ECzr16ZoR2UzVeH /SaDSjdZ0vqJ9X/5qIfwnMfMIMitlz00Z+tEXJug8BtHbd+fyVa31ymIyHzXwR16Y1 iPy0fjKfKdIcSv3RyrdGCi6Z6pOH+YvyKxAsLC813yl3if9Ea5jxwDf0IttXWLnUut r/KTj/2WW4U/PPHkMn5vGfjtAZT+0i7AWWIS1LXf9XEfsZCUSyxjAgf7g5VWe3HrEQ E2zBFdu3iIPLw== 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/7] Docs/admin-guide/mm/damon/usage: clarify quotas and watermarks sysfs interface Date: Fri, 16 Jun 2023 19:17:41 +0000 Message-Id: <20230616191742.87531-7-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230616191742.87531-1-sj@kernel.org> References: <20230616191742.87531-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" Explanation of DAMOS quotas and watermarks are not clearly explaining the meaning and expectation of each file. Add more clarification for those. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/a= dmin-guide/mm/damon/usage.rst index ea6a5dc8930e..9d3ebd70772f 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -306,7 +306,8 @@ Under the ``access_pattern`` directory, three directori= es (``sz``, ``nr_accesses``, and ``age``) each having two files (``min`` and ``max``) exist. You can set and get the access pattern for the given scheme by wri= ting to and reading from the ``min`` and ``max`` files under ``sz``, -``nr_accesses``, and ``age`` directories, respectively. +``nr_accesses``, and ``age`` directories, respectively. Note that the ``m= in`` +and the ``max`` form a closed interval. =20 schemes//quotas/ ------------------- @@ -320,7 +321,13 @@ Under ``quotas`` directory, three files (``ms``, ``byt= es``, =20 You can set the ``time quota`` in milliseconds, ``size quota`` in bytes, a= nd ``reset interval`` in milliseconds by writing the values to the three file= s, -respectively. You can also set the :ref:`prioritization weights +respectively. Then, DAMON tries to use only up to ``time quota`` millisec= onds +for applying the ``action`` to memory regions of the ``access_pattern``, a= nd to +apply the action to only up to ``bytes`` bytes of memory regions within the +``reset_interval_ms``. Setting both ``ms`` and ``bytes`` zero disables the +quota limits. + +You can also set the :ref:`prioritization weights ` for size, access frequency, an= d age in per-thousand unit by writing the values to the three files under the ``weights`` directory. --=20 2.25.1 From nobody Mon Feb 9 04:28:53 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 83490EB64D8 for ; Fri, 16 Jun 2023 19:30:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346241AbjFPTaS (ORCPT ); Fri, 16 Jun 2023 15:30:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346343AbjFPT35 (ORCPT ); Fri, 16 Jun 2023 15:29:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FC3F3C1E; Fri, 16 Jun 2023 12:29:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BB23E63E8D; Fri, 16 Jun 2023 19:17:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A20C1C433C0; Fri, 16 Jun 2023 19:17:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686943073; bh=wbuN7e/qxUK5fsj+ITNoDIFCanTeV9WF0LmR4CSecxI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fdKFp883AX88acKBHDx48kRiVvHf4vAnGts4dIlATFRaFiA+jw/b7JTmej8wv2nhF HNbZZS3cQgg3JeifwfCRmjCkyLbNgHokw7l14YBc1W2QjC0dhcZgUIKcKWwfXFcLvH 69ycl4hpVUSjoQDMDElEryIHjZISCmTUvke0cJVNE+ywuLfC5iH++zJ47DoSvBw4VQ 16Ur5CKlNnFjr9iJrW5tItSl+nLXpCJORhNcfdX40xdf5Yl7dIHLMsJMm3pvtc7qQB kMK9J6K5Q7hD8z9RqnEbNYU7Y5q7LdpgIuLtJrmQ5SZEHD+yumUVhge1LlUB9anGxN GW22IDZWslXvQ== 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/7] Docs/admin-guide/mm/damon/usage: update the ways for getting monitoring results Date: Fri, 16 Jun 2023 19:17:42 +0000 Message-Id: <20230616191742.87531-8-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230616191742.87531-1-sj@kernel.org> References: <20230616191742.87531-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 recommended ways for getting DAMON monitoring results are using tried_regions sysfs directory for partial snapshot of the results, and DAMON tracepoint for full record of the results. However, the tried_regions sysfs directory usage has not sufficiently updated on some sections of the DAMON usage document. Update those. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/a= dmin-guide/mm/damon/usage.rst index 9d3ebd70772f..2d495fa85a0e 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -19,10 +19,7 @@ DAMON provides below interfaces for different users. features by reading from and writing to special sysfs files. Therefore, you can write and use your personalized DAMON sysfs wrapper programs that reads/writes the sysfs files instead of you. The `DAMON user space tool - `_ is one example of such programs. No= te - that this interface provides only simple :ref:`statistics `= for - the monitoring results. For detailed monitoring results, DAMON provides= a - :ref:`tracepoint `. + `_ is one example of such programs. - *debugfs interface. (DEPRECATED!)* :ref:`This ` is almost identical to :ref:`sysfs inter= face `. This is deprecated, so users should move to the @@ -421,6 +418,11 @@ The directories will be removed when another special k= eyword, ``clear_schemes_tried_regions``, is written to the relevant ``kdamonds//state`` file. =20 +The expected usage of this directory is investigations of schemes' behavio= rs, +and query-like efficient data access monitoring results retrievals. For t= he +latter use case, in particular, users can set the ``action`` as ``stat`` a= nd +set the ``access pattern`` as their interested pattern that they want to q= uery. + tried_regions// ------------------ =20 @@ -771,10 +773,12 @@ root directory only. Tracepoint for Monitoring Results =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 -DAMON provides the monitoring results via a tracepoint, -``damon:damon_aggregated``. While the monitoring is turned on, you could -record the tracepoint events and show results using tracepoint supporting = tools -like ``perf``. For example:: +Users can get the monitoring results via the :ref:`tried_regions +` or a tracepoint, ``damon:damon_aggregated``. +While the tried regions directory is useful for getting a snapshot, the +tracepoint is useful for getting a full record of the results. While the +monitoring is turned on, you could record the tracepoint events and show +results using tracepoint supporting tools like ``perf``. For example:: =20 # echo on > monitor_on # perf record -e damon:damon_aggregated & --=20 2.25.1