From patchwork Thu Dec 19 04:03:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13914444 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 BD815E77184 for ; Thu, 19 Dec 2024 04:03:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D95416B0089; Wed, 18 Dec 2024 23:03:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D50F36B008A; Wed, 18 Dec 2024 23:03:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B99906B008C; Wed, 18 Dec 2024 23:03:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 99ACE6B0089 for ; Wed, 18 Dec 2024 23:03:45 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 592D6121335 for ; Thu, 19 Dec 2024 04:03:45 +0000 (UTC) X-FDA: 82910362500.17.E014DC7 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf19.hostedemail.com (Postfix) with ESMTP id 8E3A91A0003 for ; Thu, 19 Dec 2024 04:03:09 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=U2tTbxmm; spf=pass (imf19.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=1734581001; 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=FvOuyD+dzUT6bkYzQVW2IutYs0g51GNldT62UK1XMwY=; b=iO48URQFEigOVbC4qGk8M3H33NdbtzUbPNr2LDJMEO2GGg2mtRYDBf04xIYOi8vlV9oomJ ZK35upvSNEmN+Yud/YDnqw0xSSQNqbXrBgJ9e1odVp8M8+KB88BG/HQawMxiH5VmfODpcJ lbJIRfZCzMyFeW9z8EWGw1v8Yh9tdaU= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=U2tTbxmm; spf=pass (imf19.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=1734581001; a=rsa-sha256; cv=none; b=IEeqircGd5vv5QTt8N+tGo+HodFx4SZ8kN1GPTJS6doZcGw0GiKyOyEN2DpYPxte0rtLcX zToWsD5RuKDRoMzzWKC2njiSVVRrDNOKutbtZ+AtHP8eNagKpKTiZsnZA+HJT2LiQJrIo8 sv6GF5Eg9uQk68V1sIrdhO6V9nxFql8= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 9E6F55C65F4; Thu, 19 Dec 2024 04:03:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A633C4CED4; Thu, 19 Dec 2024 04:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734581022; bh=Aw/qCp2OKsDn0Vp0elm6T6OQsuDbvPiF9mR4j+5HNd8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U2tTbxmmglczCo90VZCkRAMan0dUUYbiwkWiCX2bjsVd1i+/CVEd/djOxN65DViYd HGVVxJfV0ZWEdfO90jfrdX5oVaqE/UB+bTuatA29NoQCBPHwT7S6g9ire81fx8tiwZ 61pMKZSdck6PEctLG8ntkCGUhm8PsFsefZyW4wdBaAIMY8x2kkW5VCSiVFjc4lLqVC C30C5/I+w5vNXVJOD2e635SINKRRoA5bKTvzRiGPwA+n7x1sZqXOV34DC7W0N+4LLF y/eurOoKcukW+56yU17d2jDsk9Vr84FufCsYdZaYkZpKiuKj4NL9WovsffvY0w3Cs3 kKd0N9evuuuCQ== From: SeongJae Park To: Cc: kernel-team@meta.com, SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 03/18] Docs/mm/damon/design: add 'statistics' section Date: Wed, 18 Dec 2024 20:03:12 -0800 Message-Id: <20241219040327.61902-4-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241219040327.61902-1-sj@kernel.org> References: <20241219040327.61902-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Stat-Signature: jbbmqx15gs8cdg6534u6d8rkw5qotgnp X-Rspamd-Queue-Id: 8E3A91A0003 X-Rspam-User: X-HE-Tag: 1734580989-167883 X-HE-Meta: U2FsdGVkX18lTgGTe0CV16s7+BA/PDM1khmEQGtqUgFDMtjGrfGpeDOoQyUl8nDJnI70hL4iG5kSA9K/Nb/meiKXyGstEAlz9HV3tdR/XJfeJMG5yp/tihuZZ83GwDj63EQ+gDVriy8Wu2xKCG02yTM4wR1xcY64Vp8w3zq4/z00QEXhhXMl7ji4s4RSh9tR7M8wAU3/66PqBLRTKRNxqIliABRxn8eseouyKMbXz/dJrurQxy+gyvGFJVGof4KLKEvgKbhK6ASF+N8RlOyRA2cHXLoTn3TLdfiAJqSF15mWh2sZfbeIJ7xqoY6riVsmsa7KM/ASupqvdRagfe6bd0WQF9gdKKhE1r8qev8SBNvaIGe6b/hmTn30swvFHJ8SjukdqQtepUxxtCedzXdktaSFmiPvExH7QwX3cW9mqMJ4zcl8x5b/jsQjijjrGofvZic9VAFEUKpGYh/YbXzjLFeg+wvgdSR4X7DynOO0tGGqE72Ba9oGAofpkrc1elhQ+WhlTskdfEb9R2LI3CM3e5nWl+Lrt1cJiL8P8PuxpVSXqcl75o/FVInFVrA3pWDn+4Ux8lcCTaDO61hSeKw132xm7Vt+M8O8EnB/H4NSG2rRhhY6s7pkuMxN8tGsTIGVJ2glWuhwRzkjA7Zlt30lHFEx9p3buG0HhY+thH/u07ZNYkktoM9mHBJI6B/fpItAxIvn8KZphbhWN9gekjs575OijfiUWfGYzl2Lo+aCe8HumkaTuLHvC72mLtQMuZPCM9kX9t7NtTmvVZYj0sCQj1xEnotqqeOqcfvcvSVVmIeSIIWQrAKsxSP+S0kfg8FVOZ6x3wwqqASai6eJQTuWktDOGcPbauu653U184QwpOirtYu78+IRQh725iahp86Y5Jfh1Mi1byyMSPmdOBbB6Q/mIp+DW0HZpTl8p3TUO1fiTaQ8vPwOiDEaMbycYXD5mIFemUSL3hjC5G2ZG70 exsUVNVC bPTt0qdYzrslEb0sfmGcdJtE8Fa+NdY8HhSeto1g8bquJlnyMmCqbFdzA7cvP2V2CA5WhOWs+PYNcNalmA/3yugf9GVslVBQXyYMBL8vByy6Z292tB3TYcHsU6CWrlkew0pyuTEOxve2xNWXipo+HP5o1MR9X2RaDLv06+Cc7VeLkl0wWGeTWLNoU7B2S5zGV7LZi44FhOMOFAHRPCz8EuxeUuJ6HIPIv9RxD9fBcrJC50T8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000005, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: DAMOS stats are important feature for tuning of DAMOS-based access-aware system operation, and efficient access pattern monitoring. But not well documented on the design document. Add a section on the document. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index a577ae40e71c..8710fa71ad71 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -539,6 +539,43 @@ To know how user-space can set the watermarks via :ref:`DAMON sysfs interface `, refer to :ref:`filters ` part of the documentation. +Statistics +~~~~~~~~~~ + +The statistics of DAMOS behaviors that designed to help monitoring, tuning and +debugging of DAMOS. + +DAMOS accounts below statistics for each scheme, from the beginning of the +scheme's execution. + +- ``nr_tried``: Total number of regions that the scheme is tried to be applied. +- ``sz_trtied``: Total size of regions that the scheme is tried to be applied. +- ``nr_applied``: Total number of regions that the scheme is applied. +- ``sz_applied``: Total size of regions that the scheme is applied. +- ``qt_exceeds``: Total number of times the quota of the scheme has exceeded. + +"A scheme is tried to be applied to a region" means DAMOS core logic determined +the region is eligible to apply the scheme's :ref:`action +`. The :ref:`access pattern +`, :ref:`quotas `, +:ref:`watermarks `, and :ref:`filters +` that handled on core logic could affect this. +The core logic will only ask the underlying :ref:`operation set +` to do apply the action to the region, so whether the +action is really applied or not is unclear. That's why it is called "tried". + +"A scheme is applied to a region" means the :ref:`operation set +` has applied the action to at least a part of the +region. The :ref:`filters ` that handled by the +operation set, and the types of the :ref:`action ` +and the pages of the region can affect this. For example, if a filter is set +to exclude anonymous pages and the region has only anonymous pages, or if the +action is ``pageout`` while all pages of the region are unreclaimable, applying +the action to the region will fail. + +To know how user-space can read the stats via :ref:`DAMON sysfs interface +`, refer to :ref:s`stats ` part of the +documentation. Regions Walking ~~~~~~~~~~~~~~~