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 CC9D7C54FB3 for ; Mon, 26 May 2025 21:09:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 610136B008A; Mon, 26 May 2025 17:09:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5967D6B008C; Mon, 26 May 2025 17:09:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4844F6B0092; Mon, 26 May 2025 17:09:48 -0400 (EDT) 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 1BC966B008C for ; Mon, 26 May 2025 17:09:48 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C8460140E4A for ; Mon, 26 May 2025 21:09:47 +0000 (UTC) X-FDA: 83486300814.11.9BDD7C6 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf24.hostedemail.com (Postfix) with ESMTP id 4EE72180002 for ; Mon, 26 May 2025 21:09:46 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=dpCfB67s; spf=pass (imf24.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=1748293786; 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=vWpKE4bbtNs0fvYqMJvPyfx1tiR+RU/SJY5HhnmhyUQ=; b=KDT954bxpudpQkswRQ39ulXXOOEGHi3FvJntLjh7QYqO0weXcVW12peQVkEQsSOjc1s0e2 +qw5dcELc6mg3B8Cb0jTSpEOlGdTL0cTlxHBhq9dqlWrDWTBrqWaQWl7b7+poti+HgArYB h5S36psWG2Ky5Mt7Z/Vs+syIK36zH7o= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=dpCfB67s; spf=pass (imf24.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1748293786; a=rsa-sha256; cv=none; b=WIztj61bIWLwvUFx+2dWdGYG9Vu5N/e3eM4Om2FFWhPskMkwzhQl0gtL7OfAR8IVFVgpvb wesuKmH9tkLrKtejXD2QEPasv8pBH+PGP4AkwbUyYh1IYl+USgvvnrti6shZQZKclwjF8p CcuReYS21yL3GcsZTiQyAEz1tV0Rz2s= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id C1E90A4F581; Mon, 26 May 2025 21:09:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66F4FC4CEE7; Mon, 26 May 2025 21:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748293785; bh=gYQU/YXDeNgT1BMcNObhy08nWBlr86fWpjeWwTbkqzA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dpCfB67sFVtj6tSQK8gZ8Aehs7F/HI3g5XG60XKlTbv5T3TPIglcuhMt88s/CgFzK rkO+iZxgtRgEHYpweQqMcSJtg0ovk7eoI+r7ssVXIa9HsmboXMIfqPxeHBWO/ZSH30 lx8p/RXSHVW1ILjdbjsjR84gyeg61J5t/9tK4YEgayYw5Nhu3nm6QJv0yfxZSY/7W5 7UxjOTJ2+fVJNFbuvvei1hr4DQT165rZkB3HhmZM0v640wCu/cZZbxfFpHkKo6Lnqn WealLXRjgDZboUkA+sdvr63MwjSqsLgs1iuqT6CUNRJR5NFYdMnWZG0xbrtLqfbKRZ rr8IhXr/U62FQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , 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: [PATCH 4/4] Docs/admin-guide/mm/damon: add DAMON_STAT usage document Date: Mon, 26 May 2025 14:09:36 -0700 Message-Id: <20250526210936.2744-5-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250526210936.2744-1-sj@kernel.org> References: <20250526210936.2744-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4EE72180002 X-Stat-Signature: m6zsu9439969pmahktzfc7iqfjmyz3nc X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1748293786-940946 X-HE-Meta: U2FsdGVkX18B050wE+tl7fNgjmw1ll1X94dOE5gAcaGHaT5GwL7wmf4pC+UYSnUlD4ZpT0Sli9N011fa7rIjkjlBWA/b15jsll6ubJEneLlP9Ebpgl3nzRdJlhR0eNYhReBJe7NJavXTnHJ1kBhO7nq/pL+Zc6dA880O5cx6pdjyOVVWYCz76EG9vV9LPLUxhORTUvd24x9fzwj43tit2M5ayrhkdkvnWGR0hfo5Fd87BnkdEm0nwwjZyhHGqHuTTexauUA3Zs6qTy/v0oDmh+85fN3gn7sfgPW5lmicvl7koFqL7jrA/BOVKgVOHiO6gYSEE6Egkj88kPqExx7KL0aizZo7DVDsJPYys3xfX0XUBv72nfApem0JE8NCtJrrPpKkiuBpIbn6bG3BBHCsagSzlrIFnWIULIF571bPpAlmn31CJFkjjAHnQINFbCvSZR3wHVCxoLveimsA0kzOxx5wv4Zu+XEkMGvg9mpC5R7p3VA0xQl0sJGYuH+XG2l32mv8i2k0x/k6MA6T3mLPW8gZkzpChb65OpjtHCs61CeOqc0OJFvUQm9mbkQiT2eKgff0BMn3gxBF83gBHOr1+6Vvu5qctU14qWrm3xPLjtDJqjlse7bOLwuJS75/jN6fFpUedfGoDZ6ER6ZbRk7Bi+gj03VPw61KK0AFbl0a/7xg9voQEi6spfSQFhprF6PLIyuP3nf2fkRdCmAC7+Z0/nhR7KJBgRzWNJZXbnGWnZj7OeCm48Wp50/+4gkq0SwW/QFpsr82UgW0VB1b2W+GhKX+JqqfG6CpzFmOGuW4xKgVZLHqMgykp6tbF+ilYA74qrkW/0zITFzZTTBB0ctYBSdcZs5W/B13L1J8ty1/L5dxJ1WOVOaEZ1d6+3B5CNd0jgu3JDHQuH5jzUq8FtmZw6BT0S25JkpdxWfHyQFivrd8T5M9Q5WOQMKbyRnOtCAxzyHCxc0NRI1NaHkVelL SJm/sJnu 90fHANVlyaVZZcBy4Uy4LcIWL/kF9tA/piVFfakScL51TJAIHEHdUOc5/0L5ne9NVaRzp4jhr5p/Xpnevu3/1h5iMDP3PgS+vGGHm8VBmuDlPs91xIAYYMpPa9UBQYXJM2CVT1ozTBa7urUylsv4f24uwlDz5SDK7VxDVPYTNq4yAdBzoqgp0KAwf59RNoAQw+lgM5eZXHfhW2CPGqtZsRWQo9ZGOmyc1PmUAIYMgU+ba+YbrZtfE8jlztU7VGogfmufk0SstWAKu+VtRuN3f6aY1Zg== 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: Document DAMON_STAT usage and add a link to it on DAMON admin-guide page. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/index.rst | 1 + Documentation/admin-guide/mm/damon/stat.rst | 69 ++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 Documentation/admin-guide/mm/damon/stat.rst diff --git a/Documentation/admin-guide/mm/damon/index.rst b/Documentation/admin-guide/mm/damon/index.rst index bc7e976120e0..3ce3164480c7 100644 --- a/Documentation/admin-guide/mm/damon/index.rst +++ b/Documentation/admin-guide/mm/damon/index.rst @@ -14,3 +14,4 @@ access monitoring and access-aware system operations. usage reclaim lru_sort + stat diff --git a/Documentation/admin-guide/mm/damon/stat.rst b/Documentation/admin-guide/mm/damon/stat.rst new file mode 100644 index 000000000000..4c517c2c219a --- /dev/null +++ b/Documentation/admin-guide/mm/damon/stat.rst @@ -0,0 +1,69 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=================================== +Data Access Monitoring Results Stat +=================================== + +Data Access Monitoring Results Stat (DAMON_STAT) is a static kernel module that +is aimed to be used for simple access pattern monitoring. It monitors accesses +on the system's entire physical memory using DAMON, and provides simplified +access monitoring results statistics, namely idle time percentiles and +estimated memory bandwidth. + +Monitoring Accuracy and Overhead +================================ + +DAMON_STAT uses monitoring intervals :ref:`auto-tuning +` to make its accuracy high and +overhead minimum. It auto-tunes the intervals aiming 4 % of observable access +events to be captured in each snapshot, while limiting the resulting sampling +events to be 5 milliseconds in minimum and 10 seconds in maximum. On a few +production server systems, it resulted in consuming only 0.x % single CPU time, +while capturing reasonable quality of access patterns. + +Interface: Module Parameters +============================ + +To use this feature, you should first ensure your system is running on a kernel +that is built with ``CONFIG_DAMON_STAT=y``. The feature can be enabled by +default at build time, by setting ``CONFIG_DAMON_STAT_ENABLED_DEFAULT`` true. + +To let sysadmins enable or disable it at boot and/or runtime, and read the +monitoring results, DAMON_STAT provides module parameters. Following +sections are descriptions of the parameters. + +enabled +------- + +Enable or disable DAMON_STAT. + +You can enable DAMON_STAT by setting the value of this parameter as ``Y``. +Setting it as ``N`` disables DAMON_STAT. The default value is set by +``CONFIG_DAMON_STAT_ENABLED_DEFAULT`` build config option. + +estimated_memory_bandwidth +-------------------------- + +Estimated memory bandwidth consumption (bytes per second) of the system. + +DAMON_STAT reads observed access events on the current DAMON results snapshot +and converts it to memory bandwidth consumption estimation in bytes per second. +The resulting metric is exposed to user via this read-only parameter. Because +DAMON uses sampling, this is only an estimation of the access intensity rather +than accurate memory bandwidth. + +memory_idle_ms_percentiles +-------------------------- + +Per-byte idle time (milliseconds) percentiles of the system. + +DAMON_STAT calculates how long each byte of the memory was not accessed until +now (idle time), based on the current DAMON results snapshot. If DAMON found a +region of access frequency (nr_accesses) larger than zero, every byte of the +region gets zero idle time. If a region has zero access frequency +(nr_accesses), how long the region was keeping the zero access frequency (age) +becomes the idle time of every byte of the region. Then, DAMON_STAT exposes +the percentiles of the idle time values via this read-only parameter. Reading +the parameter returns 101 idle time values in milliseconds, separated by comma. +Each value represents 0-th, 1st, 2nd, 3rd, ..., 99th and 100th percentile idle +times. -- 2.39.5