From patchwork Fri Jan 10 18:52:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13935393 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6FEDE77188 for ; Fri, 10 Jan 2025 18:52:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C8DA28D000F; Fri, 10 Jan 2025 13:52:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C17748D000E; Fri, 10 Jan 2025 13:52:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB4408D000F; Fri, 10 Jan 2025 13:52:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 8C7AB8D000E for ; Fri, 10 Jan 2025 13:52:47 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 428AE140E2D for ; Fri, 10 Jan 2025 18:52:47 +0000 (UTC) X-FDA: 82992438774.08.BD0F9A8 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf28.hostedemail.com (Postfix) with ESMTP id A9D52C0012 for ; Fri, 10 Jan 2025 18:52:45 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=lMNKBENO; spf=pass (imf28.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736535165; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/xHzKxdITLq9amvEiKJe8fX+MXHuR8Y5SH25DLls5vM=; b=P2Is6tqFCKYzRYWv7xUROiGve41uGPIMh1I+dXVjIC4j/bUcLBN4EmUoNitb38A4inenDv bDc89UGmMaEfBhnasKuLYJsInXnbGDimx3rfmiKD22FvHVVKhUn2JmlzJo+XQqwgxu1CVA 8EwqymcP5LSEnzTO5afzFd36obS+cd8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736535165; a=rsa-sha256; cv=none; b=c/aXcwLE1TEabvfTIqn+fYyJOzreLG5Jdnm2144IJTgWXLQ1gTdm/aRzZcpivDxYJZihx0 fzCoMd9rGVinRNgBOl/6k/pX5dVRWUAAvqFLlKMn38GsPLNDBBG8AJ72pSlKWzjHvD2Kxp D9WiFIexuJeoe1Yp1GC8vqT6/ryclA8= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=lMNKBENO; spf=pass (imf28.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 87D3BA428D0; Fri, 10 Jan 2025 18:50:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78C0EC4CED6; Fri, 10 Jan 2025 18:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736535164; bh=ew5XgI3zhdST5X2UaL5ouhohLppujWeUu4n87xwMgTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lMNKBENOmMQzlS+PAUYCNfYlNbOmaFYkeYcwNC3a6R18W7BN6tuZJBOqu0SpfjYKo pq0OwD4oZqBYWcENh+fgMWlWwbHxAe6diuDG/DE5UI7VNxS5U5lePu8X13ZtVHCCiT xhA+/EZdpAWjLjWHsHQFIIHkBKRowHFq6lwhpq/2ZhS/Q30SeL7hgB3kf31yPCVYxB yIWOmS/seNziAb6R9XN+SGFRXJTujhH0IS9PJrdhtTNMZswONEludKyEvJjBxi/h/0 DGqlbBU6TqWzOupor6LhgMiedHBCRNCRegZMl+iemLT/yKtv+snuFl9GHFjoWANDlU U7rpWdkkCsH0g== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 4/5] Docs/admin-guide/mm/damon/start: update snapshot example Date: Fri, 10 Jan 2025 10:52:31 -0800 Message-Id: <20250110185232.54907-5-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250110185232.54907-1-sj@kernel.org> References: <20250110185232.54907-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: A9D52C0012 X-Stat-Signature: po4awa59qychpommfk5zbe7tbck1gixc X-Rspam-User: X-HE-Tag: 1736535165-533701 X-HE-Meta: U2FsdGVkX1/H9glnk0D70ozouLO6ieuj+I6/v6YN/C6qugG1jyKih3VF7sApOVsAySTp2L3H02hYbSsCEwjKY3nZx2s1eWnQlqE3b8wRnEkL85di/jYB+4W+qm1wU6H4pMzMonsQmJl5yY6N3E+pzZXeTcsdeknLp2vG8uZX6yvbtyUvY5vXRMCWpb//5O2S/0F3SDlzQxOAyzVjzif+Qmk0aszZYzpNGEBpxI9t908ehEOTImDZ4H44S4QEfU3XYu8/N2+sNSUazOARq3t5gK7qqYEO5MAf2SvoMgBOGGQSU+CNzvAUN9XRvhy+rB5OwIU0tLhS4gAEiFfh1wHRzraD/TUrsnU2fTvX5vBNx8GaOM1/bSn6vaJcQd9BJjyY8qpeZyqvp34evVL63nQlwNrPOC5hTE1l8nWQHgs1ohp0ETn5SqnZ6AZyMA2yReBbq7yMC1fiZVlOVrTrTpdyaxIC+9rPzfnI2MVqigkXpVLUPJgZQkRrJkHqBQtqJvQ4/sZhbde+xQ2v69GxVa+ILqkbQEDDOPm5DXyN+GSZRmUr+sUCwn2J5GKfselXRU4QBeG0vnYdax9rAzeYBp1MiL35U9uxuQOs4zgRFgIrkN3UYWivWAebtn1AW4XHSEPTrdA9MeE4tN1lBxoScQVOhhLdDE/HWW3AEutE92ihbBoczIqlVUQPy/hM+N70EjTphJbvwtjYNB47gao6UOVWNGMsOHxJj1dqbcS2+db+3YVI68Davuaw4/HI/WbDStqu5gSVMvnmq4MXX2So8yRmnHc2McF1ndJ/YXWWovm0KeyduqT31zRyvNH1DU73Af97Q8uVaDgRQYB9SYehh/aRKSQD2godeSCQUd9JEUji1QRAYBLOgHWvAT76T+JlOW/zbq7YLeSeSeEOcHQhcNfVOU7V/HdwXr/7FffDxtR/TvBnMuS/CAvH+VJWt8o5xqi0787aPciPKGP3mTrcukL imZSDoZ2 yTRQMRuLp/ia0hjRCBzJSkQ3Kb/eN9A4zF3WbSCIY98bevTspGiGF+EH3bviAFGcC7SswTonTTHYYuXKXzknUMp0fM9TPiZZUWnrefNf9OyUF0YPNyGmWzT5TuANMtSCpYk9X054KDKHAgfQ8XGxaWa/XqnAmRVNKSWoHS/Q1ZWoWVdX7cOl5D/37vNGvPix2ixYhRWQnYllXLDOAEQwIxGZHpuAvGFL0rzj52B8OpbkaOgaumBBIBUI8JosT6yChAcoZ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Two of DAMON user-space tool (damo) commands that are used for examples on DAMON getting started document, namely 'damo show' and 'damo report heats' are deprecated[1,2], and replaced by new commands that provides same functions with unified and simplified user interfaces. Also the example output of 'damo show' is outdated. 'damo schemes' command is not deprecated, but users are recommended to use 'damo start' or 'damo tune' instead. Update the examples to use the replacements, recommdnations, and up-to-date output formats. [1] https://git.kernel.org/sj/damo/c/3272e0ac94ecc5e1 [2] https://git.kernel.org/sj/damo/c/da3ec66bbdd9e87d Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/start.rst | 67 ++++++++++++-------- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/start.rst b/Documentation/admin-guide/mm/damon/start.rst index c4dddf6733cd..ede14b679d02 100644 --- a/Documentation/admin-guide/mm/damon/start.rst +++ b/Documentation/admin-guide/mm/damon/start.rst @@ -42,32 +42,45 @@ 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 500 ms - 4 addr [127.649 TiB , 127.649 TiB) (9.535 MiB ) access 100 % age 300 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 100 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 + $ sudo damo report access + heatmap: 641111111000000000000000000000000000000000000000000000[...]33333333333333335557984444[...]7 + # min/max temperatures: -1,840,000,000, 370,010,000, column size: 3.925 MiB + 0 addr 86.182 TiB size 8.000 KiB access 0 % age 14.900 s + 1 addr 86.182 TiB size 8.000 KiB access 60 % age 0 ns + 2 addr 86.182 TiB size 3.422 MiB access 0 % age 4.100 s + 3 addr 86.182 TiB size 2.004 MiB access 95 % age 2.200 s + 4 addr 86.182 TiB size 29.688 MiB access 0 % age 14.100 s + 5 addr 86.182 TiB size 29.516 MiB access 0 % age 16.700 s + 6 addr 86.182 TiB size 29.633 MiB access 0 % age 17.900 s + 7 addr 86.182 TiB size 117.652 MiB access 0 % age 18.400 s + 8 addr 126.990 TiB size 62.332 MiB access 0 % age 9.500 s + 9 addr 126.990 TiB size 13.980 MiB access 0 % age 5.200 s + 10 addr 126.990 TiB size 9.539 MiB access 100 % age 3.700 s + 11 addr 126.990 TiB size 16.098 MiB access 0 % age 6.400 s + 12 addr 127.987 TiB size 132.000 KiB access 0 % age 2.900 s + total size: 314.008 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 time -(``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. +to start the program via the given command and make DAMON monitors the newly +started 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. + +The first line of the output shows the relative access temperature (hotness) of +the regions in a single row hetmap format. Each column on the heatmap +represents regions of same size on the monitored virtual address space. The +position of the colun on the row and the number on the column represents the +relative location and access temperature of the region. ``[...]`` means +unmapped huge regions on the virtual address spaces. The second line shows +additional information for better understanding the heatmap. + +Each line of the output from the third line shows which virtual address range +(``addr XX size XX``) of the process is how frequently (``access XX %``) +accessed for how long time (``age XX``). For example, the evelenth region of +~9.5 MiB size is being most frequently accessed for last 3.7 seconds. Finally, +the fourth command stops DAMON. Note that DAMON can monitor not only virtual address spaces but multiple types of address spaces including the physical address space. @@ -95,7 +108,7 @@ Visualizing Recorded Patterns You can visualize the pattern in a heatmap, showing which memory region (x-axis) got accessed when (y-axis) and how frequently (number).:: - $ sudo damo report heats --heatmap stdout + $ sudo damo report heatmap 22222222222222222222222222222222222222211111111111111111111111111111111111111100 44444444444444444444444444444444444444434444444444444444444444444444444444443200 44444444444444444444444444444444444444433444444444444444444444444444444444444200 @@ -160,6 +173,6 @@ Data Access Pattern Aware Memory Management Below command makes every memory region of size >=4K that has not accessed for >=60 seconds in your workload to be swapped out. :: - $ sudo damo schemes --damos_access_rate 0 0 --damos_sz_region 4K max \ - --damos_age 60s max --damos_action pageout \ - + $ sudo damo start --damos_access_rate 0 0 --damos_sz_region 4K max \ + --damos_age 60s max --damos_action pageout \ +