From nobody Wed Feb 11 10:00:03 2026 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 256FA243968; Mon, 26 May 2025 21:09:45 +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=1748293787; cv=none; b=RCRA0xgURJwIWkJESsiKNnTl4ZzgKRYu5C/StMMxNgkQvq4N4feo7CATXb9djkqN66PeqhykUGMfi6X7QbvrLoc5258zvptd5vjJUhBxHAlVy5bn95iLlKhsNpy94TXKoIdjTVoZAtTDCXM8+ZmvivrcwJAJLzM7GgX0uXe+7HM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748293787; c=relaxed/simple; bh=gYQU/YXDeNgT1BMcNObhy08nWBlr86fWpjeWwTbkqzA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=K6wIhFGxOxeO2b+/Sau8CUy/22IWCci6kviEBsnNAwt/yh80NUv2IlE2+JqWFPZzblF55bcOBSjjKF67ZlBrP7s7xefCMvFam4OD37FN9ThqSVmTsFpaKaEg49PWneRf+u/M3rMvr7dYt1HgxgnIM0BMDMcTCp4kWPW5xUDE3vg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dpCfB67s; 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="dpCfB67s" 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> 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" 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/a= dmin-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/ad= min-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 + +=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 +Data Access Monitoring Results Stat +=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 + +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 acc= esses +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 +=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 + +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 ac= cess +events to be captured in each snapshot, while limiting the resulting sampl= ing +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 +=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 + +To use this feature, you should first ensure your system is running on a k= ernel +that is built with ``CONFIG_DAMON_STAT=3Dy``. The feature can be enabled = by +default at build time, by setting ``CONFIG_DAMON_STAT_ENABLED_DEFAULT`` tr= ue. + +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 snaps= hot +and converts it to memory bandwidth consumption estimation in bytes per se= cond. +The resulting metric is exposed to user via this read-only parameter. Bec= ause +DAMON uses sampling, this is only an estimation of the access intensity ra= ther +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 un= til +now (idle time), based on the current DAMON results snapshot. If DAMON fo= und a +region of access frequency (nr_accesses) larger than zero, every byte of t= he +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 expos= es +the percentiles of the idle time values via this read-only parameter. Rea= ding +the parameter returns 101 idle time values in milliseconds, separated by c= omma. +Each value represents 0-th, 1st, 2nd, 3rd, ..., 99th and 100th percentile = idle +times. --=20 2.39.5