From patchwork Mon Jan 6 19:33:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13927783 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 52601E77198 for ; Mon, 6 Jan 2025 19:34:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2E55E6B009E; Mon, 6 Jan 2025 14:34:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 297CC6B009F; Mon, 6 Jan 2025 14:34:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1877D6B00A0; Mon, 6 Jan 2025 14:34:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E45816B009E for ; Mon, 6 Jan 2025 14:34:12 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 70C7514028A for ; Mon, 6 Jan 2025 19:34:12 +0000 (UTC) X-FDA: 82978027944.29.CB7BA50 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf28.hostedemail.com (Postfix) with ESMTP id CE81DC000F for ; Mon, 6 Jan 2025 19:34:10 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ed4MFfHg; 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=1736192050; 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=Gg2hAXlTiuQ78S/va6LYuB/4+qeIelkZAhVlAGD0kFc=; b=eUVwFfmjoiCf+N4s5vmkfLjQqlx8Bt1gptJnySTLlbEmNtZd/ZpjCGjgRkGYRfCmoYaMpF nCBmICntv6N/VHIuEFYwgcRfOpa2rIHkN6a2wawhg5VnBp2E5dcxu8UHRg1NvtrS/2T9Ky nIus8BdaT/L6gf2UXQDHxMcQSb2EMJA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736192050; a=rsa-sha256; cv=none; b=tRnfiqX0VmvbVI1GymhNqDhHPxqBLf4gjU3BfHWVc7SH61s+Csxlw3cPClD6xtDL8qAa6o r7OjYtWtZDFi6kONPqzfpNfwFvI5VgcBmnn6ocSoO2Dx1SwRohx42gZGejqvk1BXhDKBD4 fGmzXKWRamso1fClAE5U4IkgOGHGs9w= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ed4MFfHg; 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 5523EA41D9E; Mon, 6 Jan 2025 19:32:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFD25C4CED6; Mon, 6 Jan 2025 19:34:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736192050; bh=DyNPqMVv1qWkL7drvuA1I9SW5htKBzMRMHtsO46tXdw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ed4MFfHgRDl2+cLT291VwyY3qps68Bad9io/5jDB13HhKMjE0QfVufeCR39v5mjLG pIqzuFBY463MZ1efvzIt4UaUVWBLZAUv05VMd77Egy7FrOvQrVl8ua5lPKZ9pwTINH DBkb6MDIiXD48pH7fGXjoUnt7ljp2L+GdFzB7OedYBHAYQLduZNvjXf9zOwhpNlhZl ayF34YfrT+j2ZhwRNy/wC7Vlc8rfjXS0w4duRLoly1kuowElUXoJ59dBWTrpCH53pS DxUvBVtrcm34LWbWvertf3KlnYIRBvvB38/hnxFvAh/7xF2qkLpOXANMzuSldUNHMM iSefRCqGx86Bw== 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 02/16] Docs/mm/damon/design: add 'statistics' section Date: Mon, 6 Jan 2025 11:33:47 -0800 Message-Id: <20250106193401.109161-3-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250106193401.109161-1-sj@kernel.org> References: <20250106193401.109161-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: CE81DC000F X-Stat-Signature: jzm3m35cfi7skq7ddye3yijeq4d54ayr X-Rspam-User: X-HE-Tag: 1736192050-420962 X-HE-Meta: U2FsdGVkX1/HK+AR9OyUaBvc+h5J5Oq/EQUpgkWT3TO/Q3NxA/5+nVbGT5JiY9+UmNL0jwz3V67W3a7iJsQJdJsDMf25vDa+a+DeAwmyutztIyaqi3oYdohDW8p6+0clW/WunyMdgSWEpc9+uFbPy/ITm3FhfMPRN39tO/GCFf8gP9K6zbz/kOWHjqh44s5bkbIcXtYT82StsRdJYaBRZlGC1ZyceflygjInYBJlnRnxo4Pycnh1WqX1USaLIqXqQ67FA+CD/26SeA6ug9Lx8Zn6J7VhKbLQPndTrsvEfjnRt8c5SBr94qlZpEdkcQielF/7UF0/7fzpCK0MZ8x+9yAEZObiUzIhSBUan6xcL+QHc985R/RdUO9NYI1B//EQvCRwqYCgDzy0bFkYpKVw4VwC7ihMthJ43Nq96E12E7xqWpYIgGNb9VmTs5m/bYuIwyBZkNOEegqZYRSkXMEKrKu0ZvVL9HjF9aa0TQUb+mMPhr48U8e+63UY1h0PCNnop7K1jJtfvmq+sseLWGpio381nbnUzofAjZDCox8nXv6ZtyGNq1efaA7TPfccPLJdRcPVhBE7F4gVyJoKc1WiCZsat6yGQBqkfv0uvTNX1RKQaTjSc/YMNIeaIlCr5CFBBKPsNAulGbGxGoexSXnHGXhiWHNgWX872YYDuiVEBGm6Pc6c/tdSgyuP+F4yrz80kBOO3S3oQsW3saXADuEEhIhC6SlZGsPcTfipFC1Wf4ihkmxwrQcpakxNaIE28QzhSyE1QdYdVXmq84R7KB4u4zov3scxH1wauK9BVeURldwigcNgY35oaMEWaf793LH4PsimVCed48QNqky8JIZaNiFw2JY3JWq5KS8/wNnQUS9sS60E9WX27IpoYU2tEP4HdY6oHq7NwlUK4n6jbb8sF3HbFICFJmKYHgrfIdhq0GbUR/NqSnrId/PzWL9sLKdMWWd+JRKyZQ6YHEsyUqi 2SUmKadM 0GPu6dfSofC38AZTMEfsqdz7QCiGoUVd4VBRVfLGmuX54GPMfRxVmTYtyFTYF6ty+djJAMcDVu1QfbMG/kcfsw6sgxey/gvyWMxkA8dG8rqf7b6cq2FievUrg/QU/aIGRZZ4sAw1YQ2mOJlOvuixyOPLhxaf1J8iBsohK5T21ShIkykoCDyv6HZDd8ZNTg4kaqbgrx+jIUooP0rJZvMPhWeSVILIvOlaJdmw6DN/3AzJxQFE= 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: 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 | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index 5385ea04c2fd..aa2e4694ee14 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -539,6 +539,44 @@ 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 ~~~~~~~~~~~~~~~