From mboxrd@z Thu Jan 1 00:00:00 1970 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 E6DE6E77188 for ; Thu, 2 Jan 2025 19:01:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BCC456B00F3; Thu, 2 Jan 2025 14:01:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B56D46B00F4; Thu, 2 Jan 2025 14:01:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9A8AF6B00F6; Thu, 2 Jan 2025 14:01:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 730246B00F3 for ; Thu, 2 Jan 2025 14:01:53 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 225331402EE for ; Thu, 2 Jan 2025 19:01:53 +0000 (UTC) X-FDA: 82963430172.05.1C39BD0 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf08.hostedemail.com (Postfix) with ESMTP id 7517716001F for ; Thu, 2 Jan 2025 19:01:17 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="nnu/jGrb"; spf=pass (imf08.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 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=1735844472; 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=DrzgxQT14+VUU+hsQLpG1gK38B91NAAV/nLp85RnSsg=; b=Mfw3HMriUeaq8VTJeLA84lPAvCZOYX2JnKLHuiv/YfasQBjDOBQZCBw6Fsr3o5gNel9bvI UYphY+uv1Qo36SzL8XWBtj1qqeTc5pPpiQ/cXQvNkQrpqCYjBclfx7zq4CSoeFK7qx7GUv EqCV3bkU4neFTIv0AGpAMnui4R0ZDuE= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="nnu/jGrb"; spf=pass (imf08.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735844472; a=rsa-sha256; cv=none; b=zpJZ4BWQNDkF9vMU4gugOqcF1EgfldI75Y+QSemuCVDWEkVRB2xtoL30lB7v9qTZRf/v8K TAz637k7yGuUVdYmCijUh5UXU+XkfAoqNItPZSsUQnS/44UtuV3Myp1NlYlsGXXhw65yAd goO6XVapIoN5ZEkJDwNQoygAB2BcGuE= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 349285C61E7; Thu, 2 Jan 2025 19:01:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 199EAC4CED0; Thu, 2 Jan 2025 19:01:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1735844510; bh=aWAtO/ukWuo+Gw+e1jsTvL0mxpCCcaLZzb38C60eEgY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nnu/jGrbpuhadcwOnHRbzxn0EStgfKpQid5p2XQm3f1ageFh1KPxqlmR0bShY0i3+ HlbaWJyNJ7fKIB1OulkK6Hq9HfPLQZxpFtDFtOn4RsqkkBZzpLPk6p0FmlRcNzmKP3 Uepoo1sTpBVhZSNFVtQPbd3cD6V9DLl1OWs/rAwezKWPX8LW7DtwDiGdZbWYXhhVP5 IJ4iZmX/W8b4NP21naNNJTYBnbBVgXr9rayGPlyosMvpsF7uOiwj5/0N8Bf1+A6Ta5 of7y5RSiUFzkZClAmb4HJFI3xHcTTQnzLEj44zYoBN4hYZ1iVJPPZdDIulovSkdaau 12aTN3H48Rllg== From: SeongJae Park To: Cc: SeongJae Park , Andrew Morton , Jonathan Corbet , damon@lists.linux.dev, kernel-team@meta.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 4/5] Docs/admin-guide/mm/damon/start: update snapshot example Date: Thu, 2 Jan 2025 11:01:37 -0800 Message-Id: <20250102190138.47258-5-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250102190138.47258-1-sj@kernel.org> References: <20250102190138.47258-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7517716001F X-Rspamd-Server: rspam12 X-Stat-Signature: sjjmwgrd549f9i3oy1hgh6ebhwde3drg X-Rspam-User: X-HE-Tag: 1735844477-644232 X-HE-Meta: U2FsdGVkX19VnZjtWGRZN+XBTQME1zk2hdxXxUAgSQrCo9O2lObUZuxrrMweWHQhyeyVaZojplkWyKZ4754tjjLs/zPpfV5gSExLXjcIYjSxoCxdoiLCLrjRXAQrg3WX+3rMJvcYMuigm9kxZ4d9M+HAup5PoXneKMZ96fdnYKmzjTvpLC7ncaoDn23UYLoiWpn8cZCIY7w/8f0XHhZGi2ghnEHsEb+AFj+IKrbBFKDvSfWsB6SJwl3nG7r8T6a1BsHY7AxxMKoeDjxq+1Ty7xOMqdYrZvzFWeL+9+vGaqnqCw/tVFxUCMV11WesMidfdxdBjQqm+MXlme+BBq2phmhDupEnURdn7qQNWqHn5Itb3DpIwt19p1KB+nOC9deFeMWINQx8avt33sQys8pInfPBk5DZxwNPpNGrJrqLq0Ab6WFal3AFvfog3zqqpcfBIRRhoEiwR3HtXGxwRmgCfBQLnNgLsF4FKXo9tvudmDfLbJEftf1QRTf4Nuvp9Fr0g5R/lC4nwzPEubsogGdDKbqDWuOCfDqsJnQrTEahN6BCDHX4tO+42GQGOT3Rc963TrBrbcomzkb0epx1EVQ9ifTfR1NBwi0O12QFDLXAMto3/hOKh2j6pFG2hPy7GBuaYMmtt35x79OhJTUxC9FPWnIQN6y4wQ/M1YoxwhhpRtJvs00Rfz0WthTHv31jL6ofk2gRdGLD1cIpKWg2DhTXAti36Kf1WX56q20VKi3UxGI8wgu7NNQWq0Nh+zuPtbyHxRoG3kJl1gcR5KPUJeORNrMagU4/2q/wco+wEyJC/HoTfLOkZSK9j0Yoy4bpm6xxvl/ZqZsgrG2ceYPdcXi/ghg8ItEZH64FGBWIzpfx4N8MK5X81Qh6R/j0gDpqEiMO3sucmfjFnIXkxZZxyUCzU97mapY1KSVPq8jA69b1fNbFsMfLD2e87nEbXWWFRmXFqFGVvEiAcai+0PQeqQQ SVHX++TR 4beEuhcdk2zuLo+QCPTzdRX8lI1FQ5ePbYZdXOtPShgGPjCL0xI7vt93Br99H5EMy9dPQdE762olFgGz8D1ia7GG17afmZauQJKoMWaIzXxrX8K1Zi3N8u48D/4xt0ftm7BI1d+JknWwfDUe9rU+NwG2ngxZlrJbw0vmIGiQm55wwsrfjHFZMvRBQNrI2v3+KOH+8zyvohrXFQ6Cke2jmpr4w+zTDyePemHREbAhYiuUg0AesUHhp8JCFff2qSXGVCj6y 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 a simplified user interface. Also the example output of 'damo show' is outdasted. 'damo schemes' command is not deprecated, but users are recommended to use 'damo start' 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 \ + -- 2.39.5