From patchwork Thu Jan 2 19:01:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13924850 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 F0C54E77198 for ; Thu, 2 Jan 2025 19:01:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 710326B00F0; Thu, 2 Jan 2025 14:01:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6989B6B00F1; Thu, 2 Jan 2025 14:01:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 539646B00F2; Thu, 2 Jan 2025 14:01:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 32A9D6B00F0 for ; Thu, 2 Jan 2025 14:01:49 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id BBF491C5DE7 for ; Thu, 2 Jan 2025 19:01:48 +0000 (UTC) X-FDA: 82963429122.25.54D66AF Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf21.hostedemail.com (Postfix) with ESMTP id B478F1C0014 for ; Thu, 2 Jan 2025 19:00:09 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=KlaNlt1q; spf=pass (imf21.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=1735844483; 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=489WqIS4FGPYAKFmqMs4h4nKb5634AOpCg35Bl/JPNU=; b=7knnKeJSdH9T53pyBKzyyzvKUFLgFSnEVCDgrlNNOtpfVfpGF8VH3Z7AuJb7gdtVQH8SCT plb1nwgGoMt4GTjZaUuLy3/OIfBOvNrIeMzKewaCw+HOpkzxE9RHthR13bRnpIYtuBnIhK GLfrxH5OmjtgyXsvaYuHxeOAHeE2hc4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735844483; a=rsa-sha256; cv=none; b=dH+KMSAmFMxZS9A0EXwtRlW/y24utQdCiqylq9fnAG43DipvYDqEwcGyEOTSVO+8bOhJ0P HXKFQsRqWIBNgsHmfscN/P+maRuZofjgDWY76odk44dQJ/BXq/27zC0sIbTo05+x2fslo6 ZIVbDXEp4RtAyyL7PEW0nLLoS3znM5Y= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=KlaNlt1q; spf=pass (imf21.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 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E172F5C61E1; Thu, 2 Jan 2025 19:01:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8238C4CEDC; Thu, 2 Jan 2025 19:01:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1735844506; bh=4/XblnIScbbgUAgFK7pLL4JlbO5Pquped+azNdLMH04=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KlaNlt1q/Xrnqg9KnIF0LC2RgX+Ac0rYTpw11hklMkfAH+IxAsVsRuJCJ5h4yXHLe IfhtvCRALqjhqW1nvvDtp0Q/us47BbG5lAbxh8wH8u7+CdOGvO95WwZFNwSp3pdgV2 iKxRQ9X6q7XuGXlR/GV07BAQuIzTCQsqRrBwvUyqqdBbBJoYZ0OML/bIDrPJRTYwGS 5+9/kuIUoWmzE9be7bb1pLwsA7T5I5TSK2V6wUag6gE4vzlnBZFYe0UmHrTDD1p8ym oFlbv/P89jGbMgaBZkNDW4oWBg/aD4tuUQbzw/sz3/DpxjFtbUHrPiWaQkOZIvHm3Q hNAbNN++fIYbQ== 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 1/5] Docs/mm/damon/design: add monitoring parameters tuning guide Date: Thu, 2 Jan 2025 11:01:34 -0800 Message-Id: <20250102190138.47258-2-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 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: B478F1C0014 X-Stat-Signature: odxds9wk6z8yczpsbb18ooccbgswgx4x X-Rspam-User: X-HE-Tag: 1735844409-54499 X-HE-Meta: U2FsdGVkX1+iSCNV9mJrJ7t64NDgz9wPQtRJSyHqq90vyegthvZWOGRq8MC2Zsj43opec4ZkWcO31fQaWpN4hmd5SXbN1ZmWFqsvlx6i9/J7/jliKD2T7G/Pz5YvHlgnJ41s6z4bdNdEUt58L+NqHtv394AgooyTJMNtem/V09QQZwOj/2bPke+XB1Wqj5t5FTQ3QlPl2ALMp1s3noRElo0TEwnNGUSkxxRyFR4vyhyc5IH9eXIy7PhSxHPH0azjIDNmTDhUlqIg/leSjScR3nYaIP5NTqgdBpz9ZeScYyze+HIUAXAQ8riEAClPzRl0v8Ge26msLRndhh/iyLbMNV/2GmGTg1f0uLfLisUy+AgD7JqaC/h4BxbyJ4EDr2Xlllf7apAQxrjDjXKSer3YHoMqVuV/h8O3boIWG9zW79yEuFJQxVJPMXZDhFVkikAIHxUX73xW/qO8Jo+PmlFdZPSTAvyuGqf5hIQaJvEpMULTTLr1up2NYlbOZgXMPZNrDIRTlPQC39eBE6DnFnnoWfLtl7fX/12ut7VOXduUe3mOwzxuV8/H0RG70B9ajwLUyJZBhvC8NMipU0lCjk8PGnMYpGPcQ+z1IYVIPkCs71Xe8X7T4SNe5THDy0U77Iz2N+PSY0h9jv3/fb6ocdfa+LcwfeR2tsCFBGl6k8erMEz9ntOYYzfhMUZf4iTao6HMsFuZjVbUflcWlK0VUU7+0eEgXUsPxbyX3JsZGZKE5QIkqzCbHUbgN0DPP8msEJGCusc2V97O2Jm7vlOPKe2ldQPGC+ymvOfLWUTTn6P2D5bMk4ABWNwQ/haakqerGbpmty2kWfVR2CUfnrbam2i5Azc2AvSLVZ1BxIap4wWaaZZ8GB5+/qHVPCoq7qycbO+Vnts2qh3V8ATx2m0Atq/6vKCnqYEql1gqwL0NgIhuqAaeFl87EM92knrY6L1TxCqGQINrSITMZ4JF2JhSdAM sIffooOm ILaU4/XdDHrx+PFRanSTmJygwmmQI6d1QyqOIVs2ELHOWazxkq/MovkWUI5Vc2qUEx0IjvJ3lhu/96gIik5FFbbWeSZOMU0VeOf5dnPwu3uDirn/103a99dLErUnCh/aVn2NdjYtxBxdZV5TTlR6Hkb8NNJyEmINwOLYNjxu2az+4/XpNz2beRx3MrO6zGJSSBnDpp6rC2lPchqXxtjdRaFMkrdAN+XKEt/+DLdYWQjV0z9g= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000032, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: DAMON monitoring parameters including sampling and aggregation intervals require tunings for given workloads. However, the fact is not explicitly documented. Also there is no official guide to help the tuning. This apparently confused a number of people[1]. Add a guide on the design document. [1] https://lore.kernel.org/20241202175459.2005526-1-sj@kernel.org Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index 0265aaef2544..cc405e15d1b2 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -203,6 +203,8 @@ This scheme, however, cannot preserve the quality of the output if the assumption is not guaranteed. +.. _damon_design_adaptive_regions_adjustment: + Adaptive Regions Adjustment ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -264,6 +266,52 @@ tracepoints. For more details, please refer to the documentations for respectively. +Monitoring Parameters Tuning Guide +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In short, set ``aggregation interval`` to capture meaningful amount of accesses +for the purpose. The amount of accesses can be measured using ``nr_accesses`` +and ``age`` of regions in the aggregated monitoring results snapshot. The +default value of the interval, ``100ms``, turns out to be too short in many +cases. Set ``sampling interval`` proportional to ``aggregation interval``. By +default, ``1/20`` is recommended as the ratio. + +``Aggregation interval`` should be set as the time interval that the workload +can make an amount of accesses for the monitoring purpose, within the interval. +If the interval is too short, only small number of accesses are captured. As a +result, the monitoring results look everything is samely accessed only rarely. +For many purposes, that would be useless. If it is too long, however, the time +to converge regions with the :ref:`regions adjustment mechanism +` can be too long, depending on the +time scale of the given purpose. This could happen if the workload is actually +making only rare accesses but the user thinks the amount of accesses for the +monitoring purpose too high. For such cases, the target amount of access to +capture per ``aggregation interval`` should carefully reconsidered. Also, note +that the captured amount of accesses is represented with not only +``nr_accesses``, but also ``age``. For example, even if every region on the +monitoring results show zero ``nr_accesses``, regions could still be +distinguished using ``age`` values as the recency information. + +Hence the optimum value of ``aggregation interval`` depends on the access +intensiveness of the workload. The user should tune the interval based on the +amount of access that captured on each aggregated snapshot of the monitoring +results. + +Note that the default value of the interval is 100 milliseconds, which is too +short in many cases, especially on large systems. + +``Sampling interval`` defines the resolution of each aggregation. If it is set +too large, monitoring results will look like every region was samely rarely +accessed, or samely frequently accessed. That is, regions become +undistinguishable based on access pattern, and therefore the results will be +useless in many use cases. If ``sampling interval`` is too small, it will not +degrade the resolution, but will increase the monitoring overhead. If it is +appropriate enough to provide a resolution of the monitoring results that +sufficient for the given purpose, it shouldn't be unnecessarily further +lowered. It is recommended to be set proportional to ``aggregation interval``. +By default, the ratio is set as ``1/20``, and it is still recommended. + + .. _damon_design_damos: Operation Schemes From patchwork Thu Jan 2 19:01:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13924851 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 36834E77197 for ; Thu, 2 Jan 2025 19:01:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ABA996B00F2; Thu, 2 Jan 2025 14:01:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A6B4A6B00F3; Thu, 2 Jan 2025 14:01:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 895F26B00F4; Thu, 2 Jan 2025 14:01:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6250F6B00F2 for ; Thu, 2 Jan 2025 14:01:51 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1EC8E120302 for ; Thu, 2 Jan 2025 19:01:51 +0000 (UTC) X-FDA: 82963429962.15.42A8DD5 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf25.hostedemail.com (Postfix) with ESMTP id 07D24A001A for ; Thu, 2 Jan 2025 19:01:12 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=nMnc0YfE; spf=pass (imf25.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=1735844457; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=I50fLWtEWCeQ66EUzsR9EBfOwR1sJbSprz7dyL2IQpo=; b=ffgs70GC3lJ0yqN7KSN5hsoS40gyRftUSO3i4ES9tGNqTA49jwVEqITX/Tp0TJ242zqGfh hXytLK48B/XFjDCIQnJ46BUquFFX2gxsUxMnOUqN8M9Eq2t6NSdRPpeokfVxXRby2OXwRi jmcDG9nX6KXj9u15kA7WBUeRvYJt9Co= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=nMnc0YfE; spf=pass (imf25.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=1735844457; a=rsa-sha256; cv=none; b=uCo4saS5As/Zyad0MUZFv7QR0NKXr3upUJhIrbpUPJTXFTiYLXK+E5RLGvj1c05/+vHazJ DYXQ2Stxk2KFm006Q9UentiEzu9KPtDbXH6/i/EU8UO6V7XOllB7XBOKEC2UMVMjvXdJIu tUjK4Fu/xw0dymM4uCGn6y3U0JgoPfE= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 34BEC5C6252; Thu, 2 Jan 2025 19:01:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB141C4AF09; Thu, 2 Jan 2025 19:01:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1735844508; bh=OYYSIzDz6vCDJMj+2WTbNJhocSwTQ7N8sl66wc9BMJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nMnc0YfE1Neu4L/4fcyrCd4npQNt4JkDJDJgPwP11kRirqMZ1R+ZZiquowUbV99KG +RzOxtO18F0DqS6olQimGIOY99UXsdCPMkz18U0Jb8JW+p185+f8W9lWYFGgAjFh2y ll3ifZLlnT3r6frIvRs5oQiTkltArCCArhCZC3iICm8QLbbDnRjYTUDLnM9IfRhF74 Kfpe6rToCUD6obm8e6wSikkg70r3ddqpbkuIpgYXHhywYBG2pl5XrqhRPIM6Zjp6at +2Hurb8clVqlNeStzfJUrT1mAz38jDxwOcJFelHFVu4aXOnK37dYDDl0jeUMrhoq7C ADs+zILD1e7hw== 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 2/5] Docs/mm/damon: add an example monitoring intervals tuning Date: Thu, 2 Jan 2025 11:01:35 -0800 Message-Id: <20250102190138.47258-3-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 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 07D24A001A X-Rspam-User: X-Stat-Signature: atwtz9ipjpfnb8jugjj8jjnjrdqroake X-HE-Tag: 1735844472-488262 X-HE-Meta: U2FsdGVkX18Su0K2nwTJr7T+16iEZWMFrWdSg/7yzejZQ1WSOTWlA9Zxo1Jl3Hl42mhAXkYKd3sKukBzuv/gEcqCYG2kfBQNi6aNzvoYP3JLWfRun44yQBoHtJzsW7nykkP/ZLdcrQTDwOznAaBAISXIjHGWIQx94Ef7LRK/wKc/B9Ry7zxdmJ3ezNCMM9yfWcM3DfNO4u+u+/uzrYvxwKe3BbeRPq+5Y8b62GUxeb78FZp/L/oRmgyMJx8pDG0I1/sZgzJmN4M10kTrmb0GLkT/m9yyXaW2YYWE+Y+DeiQ7hEN+6M/+A5OY7z2gc/zmwS7O72HwdTrtvRlBEtCWVZAzvCjMDpm/lju1gVtWMqk3K2Yc/Kjo5xmq5WmUmWRvkpvKl1SHW/7QG6L+QA38ouv6IaqT6YVRAuiKyWqFgXbSij9J5923NOUobtlr8LIdW2CDzymQKCZEJeURCoqLkp+dfTkpsb4kCl2RKXKg/e1iaZn667adDsNC2CW5JazoC4rbf8Yd6HCs/+70hl6YVhKghLMir4Q6x3rOOiH02p53PKB0VZQ1hro6faKyX7jayZe0F10I6d3NeBf2+WlRi8ba1sZJWvajfq+WbpBz3yqQ6gXVcqgY8Pvmg5gyzGsG8WbizbdNXObGSe5A22/0QOTrwWvcYPMFDJ4dcLyECVQJ/otg1yp7wsow5U5GUbQni7zQFLTNYRqWfoayxB9y3badSwNbey2SiGZFwsjEJsNwuAb373TWeHck1MoOgTWoePdVzPG6plBlBw96LgqJdAKbetaKCta2PL63MGf5VHZkNvuLLzGxymeohvlvZVMhU+4h9eHARHmIifEI83GJjK+IPtnJ4T8pYX8NinyDhKDEWdW1FbDskN4vOIG3qRvIKcJKvnBK3f67Z4QiUy3VnGH7f5ESc+DA/fMFmCs0MEUTbpEzAgYm4zuszwNIozRvEqjTlsi9QFn/b4rHSba seB6DCIu VaNcrHHYfjKDZb58MOslOeEJmuOFmAfZrawq8BnCDrMMNASNL0/2YYN1bMjH7ZOfIJVdhLmaHo3tqrSjZNDMdvct9WUr62eQwcaT80YI3tE7uT1KMRduftMV+kICDej69FQ5G0NJ+NTlvgyvoLHeb9HPB55CB9pVue4M9m7RwEFk6q+aahVTnaRKIkV/CSPybWO6pDVwtcVa5grqbWn9CY5PUlp15Nzs3oMkugEN8S0qL51a2Gk7oV8A13BEK5CItKnQ9iHZf7IrNrnkJALFJEGH6MRO/eYfL5wwo X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Add a DAMON monitoring intervals tuning example that follows the guide. The example includes outputs of the tuning steps which are collected from a real server workloads. The example will help users better understand the guide and what outputs they can expect in what way. The easier understanding and verification of the expectation will also help finding rooms to improvement on the guide. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 9 + .../monitoring_intervals_tuning_example.rst | 247 ++++++++++++++++++ 2 files changed, 256 insertions(+) create mode 100644 Documentation/mm/damon/monitoring_intervals_tuning_example.rst diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index cc405e15d1b2..dd654720c433 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -266,6 +266,8 @@ tracepoints. For more details, please refer to the documentations for respectively. +.. _damon_design_monitoring_params_tuning_guide: + Monitoring Parameters Tuning Guide ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -311,6 +313,13 @@ sufficient for the given purpose, it shouldn't be unnecessarily further lowered. It is recommended to be set proportional to ``aggregation interval``. By default, the ratio is set as ``1/20``, and it is still recommended. +Refer to below documents for an example tuning based on the above guide. + +.. toctree:: + :maxdepth: 1 + + monitoring_intervals_tuning_example + .. _damon_design_damos: diff --git a/Documentation/mm/damon/monitoring_intervals_tuning_example.rst b/Documentation/mm/damon/monitoring_intervals_tuning_example.rst new file mode 100644 index 000000000000..334a854efb40 --- /dev/null +++ b/Documentation/mm/damon/monitoring_intervals_tuning_example.rst @@ -0,0 +1,247 @@ +.. SPDX-License-Identifier: GPL-2.0 + +================================================= +DAMON Moniting Interval Parameters Tuning Example +================================================= + +DAMON's monitoring parameters need tuning based on given workload and the +monitoring purpose. There is a :ref:`tuning guide +` for that. This document +provides an example tuning based on the guide. + +Setup +===== + +For below example, DAMON of Linux kernel v6.11 and `damo +`_ (DAMON user-space tool) v2.5.9 was used to +monitor and visualize access patterns on the physical address space of a system +running a real-world server workload. + +5ms/100ms intervals: Too Short Interval +======================================= + +Let's start by capturing the access pattern snapshot on the physical address +space of the system using DAMON, with the default interval parameters (5 +milliseconds and 100 milliseconds for the sampling and the aggregation +intervals, respectively). Wait ten minutes between the start of DAMON and +the capturing of the snapshot, to show a meaningful time-wise access patterns. +:: + + # damo start + # sleep 600 + # damo record --snapshot 0 1 + # damo stop + +Then, list the DAMON-found regions of different access patterns, sorted by the +"access temperature". "Access temperature" is a metric representing the +access-hotness of a region. It is calculated as a weighted sum of the access +frequency and the age of the region. If the access frequency is 0 %, the +temperature is multipled by minus one. That is, if a region is not accessed, +it gets minus temperature and it gets lower as not accessed for longer time. +The sorting is in temperature-ascendint order, so the region at the top of the +list is the coldest, and the one at the bottom is the hottest one. :: + + # damo report access --sort_regions_by temperature + 0 addr 16.052 GiB size 5.985 GiB access 0 % age 5.900 s # coldest + 1 addr 22.037 GiB size 6.029 GiB access 0 % age 5.300 s + 2 addr 28.065 GiB size 6.045 GiB access 0 % age 5.200 s + 3 addr 10.069 GiB size 5.983 GiB access 0 % age 4.500 s + 4 addr 4.000 GiB size 6.069 GiB access 0 % age 4.400 s + 5 addr 62.008 GiB size 3.992 GiB access 0 % age 3.700 s + 6 addr 56.795 GiB size 5.213 GiB access 0 % age 3.300 s + 7 addr 39.393 GiB size 6.096 GiB access 0 % age 2.800 s + 8 addr 50.782 GiB size 6.012 GiB access 0 % age 2.800 s + 9 addr 34.111 GiB size 5.282 GiB access 0 % age 2.300 s + 10 addr 45.489 GiB size 5.293 GiB access 0 % age 1.800 s # hottest + total size: 62.000 GiB + +The list shows not seemingly hot regions, and only minimum access pattern +diversity. Every region has zero access frequency. The number of region is +10, which is the default ``min_nr_regions value``. Size of each region is also +nearly idential. We can suspect this is because “adaptive regions adjustment” +mechanism was not well working. As the guide suggested, we can get relative +hotness of regions using ``age`` as the recency information. That would be +better than nothing, but given the fact that the longest age is only about 6 +seconds while we waited about ten minuts, it is unclear how useful this will +be. + +The temperature ranges to total size of regions of each range histogram +visualization of the results also shows no interesting distribution pattern. :: + + # damo report access --style temperature-sz-hist + + [-,590,000,000, -,549,000,000) 5.985 GiB |********** | + [-,549,000,000, -,508,000,000) 12.074 GiB |********************| + [-,508,000,000, -,467,000,000) 0 B | | + [-,467,000,000, -,426,000,000) 12.052 GiB |********************| + [-,426,000,000, -,385,000,000) 0 B | | + [-,385,000,000, -,344,000,000) 3.992 GiB |******* | + [-,344,000,000, -,303,000,000) 5.213 GiB |********* | + [-,303,000,000, -,262,000,000) 12.109 GiB |********************| + [-,262,000,000, -,221,000,000) 5.282 GiB |********* | + [-,221,000,000, -,180,000,000) 0 B | | + [-,180,000,000, -,139,000,000) 5.293 GiB |********* | + total size: 62.000 GiB + +In short, the parameters provide poor quality monitoring results for hot +regions detection. According to the :ref:`guide +`, this is due to the too short +aggregation interval. + +100ms/2s intervals: Starts Showing Small Hot Regions +==================================================== + +Following the guide, increase the interval 20 times (100 milliseocnds and 2 +seconds for sampling and aggregation intervals, respectively). :: + + # damo start -s 100ms -a 2s + # sleep 600 + # damo record --snapshot 0 1 + # damo stop + # damo report access --sort_regions_by temperature + 0 addr 10.180 GiB size 6.117 GiB access 0 % age 7 m 8 s # coldest + 1 addr 49.275 GiB size 6.195 GiB access 0 % age 6 m 14 s + 2 addr 62.421 GiB size 3.579 GiB access 0 % age 6 m 4 s + 3 addr 40.154 GiB size 6.127 GiB access 0 % age 5 m 40 s + 4 addr 16.296 GiB size 6.182 GiB access 0 % age 5 m 32 s + 5 addr 34.254 GiB size 5.899 GiB access 0 % age 5 m 24 s + 6 addr 46.281 GiB size 2.995 GiB access 0 % age 5 m 20 s + 7 addr 28.420 GiB size 5.835 GiB access 0 % age 5 m 6 s + 8 addr 4.000 GiB size 6.180 GiB access 0 % age 4 m 16 s + 9 addr 22.478 GiB size 5.942 GiB access 0 % age 3 m 58 s + 10 addr 55.470 GiB size 915.645 MiB access 0 % age 3 m 6 s + 11 addr 56.364 GiB size 6.056 GiB access 0 % age 2 m 8 s + 12 addr 56.364 GiB size 4.000 KiB access 95 % age 16 s + 13 addr 49.275 GiB size 4.000 KiB access 100 % age 8 m 24 s # hottest + total size: 62.000 GiB + # damo report access --style temperature-sz-hist + + [-42,800,000,000, -33,479,999,000) 22.018 GiB |***************** | + [-33,479,999,000, -24,159,998,000) 27.090 GiB |********************| + [-24,159,998,000, -14,839,997,000) 6.836 GiB |****** | + [-14,839,997,000, -5,519,996,000) 6.056 GiB |***** | + [-5,519,996,000, 3,800,005,000) 4.000 KiB |* | + [3,800,005,000, 13,120,006,000) 0 B | | + [13,120,006,000, 22,440,007,000) 0 B | | + [22,440,007,000, 31,760,008,000) 0 B | | + [31,760,008,000, 41,080,009,000) 0 B | | + [41,080,009,000, 50,400,010,000) 0 B | | + [50,400,010,000, 59,720,011,000) 4.000 KiB |* | + total size: 62.000 GiB + +DAMON found two distinct 4 KiB regions that pretty hot. The regions are also +well aged. The hottest 4 KiB region was keeping the access frequency for about +8 minutes, and the coldest region was keeping no access for about 7 minutes. +The distribution on the histogram also looks like having a pattern. + +Especially, the finding of the 4 KiB regions among the 62 GiB total memory +shows DAMON’s adaptive regions adjustment is working as designed. + +Still the number of regions is close to the ``min_nr_regions``, and sizes of +cold regions are similar, though. Apparently it is improved, but it still has +rooms to improve. + +400ms/8s intervals: Pretty Improved Results +=========================================== + +Increase the intervals four times (400 milliseconds and 8 seconds +for sampling and aggregation intervals, respectively). :: + + # damo start -s 400ms -a 8s + # sleep 600 + # damo record --snapshot 0 1 + # damo stop + # damo report access --sort_regions_by temperature + 0 addr 64.492 GiB size 1.508 GiB access 0 % age 6 m 48 s # coldest + 1 addr 21.749 GiB size 5.674 GiB access 0 % age 6 m 8 s + 2 addr 27.422 GiB size 5.801 GiB access 0 % age 6 m + 3 addr 49.431 GiB size 8.675 GiB access 0 % age 5 m 28 s + 4 addr 33.223 GiB size 5.645 GiB access 0 % age 5 m 12 s + 5 addr 58.321 GiB size 6.170 GiB access 0 % age 5 m 4 s + [...] + 25 addr 6.615 GiB size 297.531 MiB access 15 % age 0 ns + 26 addr 9.513 GiB size 12.000 KiB access 20 % age 0 ns + 27 addr 9.511 GiB size 108.000 KiB access 25 % age 0 ns + 28 addr 9.513 GiB size 20.000 KiB access 25 % age 0 ns + 29 addr 9.511 GiB size 12.000 KiB access 30 % age 0 ns + 30 addr 9.520 GiB size 4.000 KiB access 40 % age 0 ns + [...] + 41 addr 9.520 GiB size 4.000 KiB access 80 % age 56 s + 42 addr 9.511 GiB size 12.000 KiB access 100 % age 6 m 16 s + 43 addr 58.321 GiB size 4.000 KiB access 100 % age 6 m 24 s + 44 addr 9.512 GiB size 4.000 KiB access 100 % age 6 m 48 s + 45 addr 58.106 GiB size 4.000 KiB access 100 % age 6 m 48 s # hottest + total size: 62.000 GiB + # damo report access --style temperature-sz-hist + + [-40,800,000,000, -32,639,999,000) 21.657 GiB |********************| + [-32,639,999,000, -24,479,998,000) 17.938 GiB |***************** | + [-24,479,998,000, -16,319,997,000) 16.885 GiB |**************** | + [-16,319,997,000, -8,159,996,000) 586.879 MiB |* | + [-8,159,996,000, 5,000) 4.946 GiB |***** | + [5,000, 8,160,006,000) 260.000 KiB |* | + [8,160,006,000, 16,320,007,000) 0 B | | + [16,320,007,000, 24,480,008,000) 0 B | | + [24,480,008,000, 32,640,009,000) 0 B | | + [32,640,009,000, 40,800,010,000) 16.000 KiB |* | + [40,800,010,000, 48,960,011,000) 8.000 KiB |* | + total size: 62.000 GiB + +The number of regions having different access patterns has significantly +increased. Size of each region is also more varied. Total size of non-zero +access frequency regions is also significantly increased. Maybe this is already +good enough to make some meaningful memory management efficieny changes. + +800ms/16s intervals: Another bias +================================= + +Further double the intervals (800 milliseconds and 16 seconds for sampling +and aggregation intervals, respectively). The results is more improved for the +hot regions detection, but starts looking degrading cold regions detection. :: + + # damo start -s 800ms -a 16s + # sleep 600 + # damo record --snapshot 0 1 + # damo stop + # damo report access --sort_regions_by temperature + 0 addr 64.781 GiB size 1.219 GiB access 0 % age 4 m 48 s + 1 addr 24.505 GiB size 2.475 GiB access 0 % age 4 m 16 s + 2 addr 26.980 GiB size 504.273 MiB access 0 % age 4 m + 3 addr 29.443 GiB size 2.462 GiB access 0 % age 4 m + 4 addr 37.264 GiB size 5.645 GiB access 0 % age 4 m + 5 addr 31.905 GiB size 5.359 GiB access 0 % age 3 m 44 s + [...] + 20 addr 8.711 GiB size 40.000 KiB access 5 % age 2 m 40 s + 21 addr 27.473 GiB size 1.970 GiB access 5 % age 4 m + 22 addr 48.185 GiB size 4.625 GiB access 5 % age 4 m + 23 addr 47.304 GiB size 902.117 MiB access 10 % age 4 m + 24 addr 8.711 GiB size 4.000 KiB access 100 % age 4 m + 25 addr 20.793 GiB size 3.713 GiB access 5 % age 4 m 16 s + 26 addr 8.773 GiB size 4.000 KiB access 100 % age 4 m 16 s + total size: 62.000 GiB + # damo report access --style temperature-sz-hist + + [-28,800,000,000, -23,359,999,000) 12.294 GiB |***************** | + [-23,359,999,000, -17,919,998,000) 9.753 GiB |************* | + [-17,919,998,000, -12,479,997,000) 15.131 GiB |********************| + [-12,479,997,000, -7,039,996,000) 0 B | | + [-7,039,996,000, -1,599,995,000) 7.506 GiB |********** | + [-1,599,995,000, 3,840,006,000) 6.127 GiB |********* | + [3,840,006,000, 9,280,007,000) 0 B | | + [9,280,007,000, 14,720,008,000) 136.000 KiB |* | + [14,720,008,000, 20,160,009,000) 40.000 KiB |* | + [20,160,009,000, 25,600,010,000) 11.188 GiB |*************** | + [25,600,010,000, 31,040,011,000) 4.000 KiB |* | + total size: 62.000 GiB + +It found more non-zero access frequency regions. The number of regions is still +much higher than the ``min_nr_regions``, but it is reduced from that of the +previous setup. And apparently the distribution seems bit biased to hot +regions. + +Conclusion +========== + +With the above experimental tuning results, we can conclude the theory and the +guide makes sense to at least this workload, and could be applied to similar +cases. From patchwork Thu Jan 2 19:01:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13924852 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 97191E77198 for ; Thu, 2 Jan 2025 19:01:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 010486B00A2; Thu, 2 Jan 2025 14:01:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EFDDD6B00F4; Thu, 2 Jan 2025 14:01:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D9E666B00F5; Thu, 2 Jan 2025 14:01:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id B46466B00F3 for ; Thu, 2 Jan 2025 14:01:52 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3FD5CAE9D8 for ; Thu, 2 Jan 2025 19:01:52 +0000 (UTC) X-FDA: 82963429752.26.7CAD742 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf22.hostedemail.com (Postfix) with ESMTP id 1425EC0004 for ; Thu, 2 Jan 2025 19:00:57 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ZgEmnE9M; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735844463; a=rsa-sha256; cv=none; b=unqoh7YNQWYD41wnBo6z/1fmL0ug+qyADkrDlKiN240zyDH6dtXWzMyIjBZ0j6uJ4Vwdh5 ZP6R2PrEJnDW+KEmVsUuWynB1ZXQ7aU/ojw0oNJ8826mQQEBxImeQWhXgjJTbH6GjFIzkw UY6LrMXe63cWufpw6jWk+QsP/Tn2gzM= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ZgEmnE9M; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1735844463; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=qvuqVH81u6zvqae4ZpY8I8lSR4aKbFiaYqkQM2a8aD0=; b=1X58XRsGvOItDJhMQLC7kJ+c/3tYMBwrKbC043C0Rg8FqYjDJKipplBUvYr1Q0U7ALej9E Efwz1bQFcBdwRiSkTuQRHx/fklIbw9yevwJO0Q0d8JWf23yHUHyXAp7OtyESYfLKKCspe/ 1pKZNBU2k6ccK3ZLtZ/Uqp6tvhIdIDw= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 3AE3B5C6214; Thu, 2 Jan 2025 19:01:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 171AAC4CEE4; Thu, 2 Jan 2025 19:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1735844509; bh=UnJyVIKRtYQAQG2EpBsfZO/49jup78sa4mglOLthEos=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZgEmnE9Mp+px/eZdPFF6nYV98HWNhak7ZEWvExNSAZWSqNJz++d1+QOARODg/hjtD kRyHquK5TdesMpSfbHw6gR46FsyYN+shjdMQV7QM+OFKh4qYmYkd8mKlIEV7GavxNM GiGbZiLU7z70TNxyqLu/K95kYCo5HAfOOKoGDgONllRE8KZsrPUUygBRk/2+wF0fxk CcmeP1z4hxLeeRyXwNaOvbr7UAPLr7M5ZlXin/3I0RHGA0EZj2RGDFAsIIzLdlb8qX aA2oNPHrlxRui+fJ7FmDiqZRiZWsF1hgOjQxBJZvO7J4PO1YjhcmWuVqi1eSSMId+Y PlaDp0WA9gSIg== 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 3/5] Docs/admin-guide/mm/damon/usage: fix and add missing DAMOS filter sysfs files on files hierarchy Date: Thu, 2 Jan 2025 11:01:36 -0800 Message-Id: <20250102190138.47258-4-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 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 1425EC0004 X-Stat-Signature: jhrcg4jb7m7qtwu1bd91xjpq7f4e43ec X-Rspam-User: X-HE-Tag: 1735844457-802721 X-HE-Meta: U2FsdGVkX1+nrdw7Vtn4W/DGnjBKyM5a9/PoFSj8gKpOriwZ0ekjtj+qKS/NWsDh1WOAMFEZwgMLuVXrauUlmXLtUaBP7nFDU5LygCgvFhoUcX0skrplhEysmTsO/7WygES2SnCOyCnPWoOw4EgY1lmZehpynGc1I0pmJYpxkmega8Qm/Xhfz0MuHuOYMuvDaqxdDRwm4cXG10FXewX1pKlf91w7rLrvlxICVqtwlhS8WD5a4VVXDL3YBbvA5MrSGIQsYcw9SCqiyT6V6l7ID+SdOe/m/m8iy7U4QiFWJg3HCxDLzDlNXmLztVaQ5R2ziS+BAv2om9LYQqe9KTUC5O0Nm+j5C7mVhECW1zhzry6poHnZcp3OSLLI+e+8++rAPhGT4KyrmAPszG9/9tmOBaUlcAxvwiLfA+Q0Af+vFdE+4iP/ZxkgA3bJ9q61czDwquPLjhUl8qOWVnDHIxpk+AH4Wi7y+4XZqTbkDlKiwsZTcEVZKXyzEwczUXw+ZStdncnnGr0Ud9CEO8tse1njaCfTpcBfwq+dqYLPR+n6TekKNk1h7oN5TRjaoJF9yQNlCfiwxnEh4uSt+SkalJs2Y2hDIP5j187k/PU6md/vli98xx6VE+TQzRe+Lh1kkeJHst15hrWxaDQlrzhuU62sTngndcblqEtwpB7tNZLvczBQ9P/Zn8/euHSlA9YUWsiguWci/OoI/Z3iXEdbIY4IVBbGJjegd5kHiZd4jzXlvgYFcc76nMNdg+Qs0KVi0yraT1260sNU6dbtceqXyLK9mbxUzaRkPYPBhRCOqOhmDfOWP6pcDog7BfvpgYzDX8Q4KvemqKkTNHGG6UEUJEMsqRTMt2st7BCWrnZfVJZ2HBnpb8IGsD8DC11zG+gjJxQp2TboNg21G0kfCQqiZ9TRmWUOW0vGjv+plkHk78hLUZhWosJDPyqaoki93wZHlOTJaoVxjvIiq5B/XyFs1Iw LkOXquZA 7Td1oLXNhd/BqvV5nQLcjg82reu1urcnm2qPx6XdqJnT2KdoAWdjefCQYG5u2C95H3dQv2auNkK+TEw9Y+GSMjwsC5O42o+8yLtXsUDhBPFh8HVmfhC5agfCiEHsrJcI3C5613yJPYjCxeaaqjmYzMRxtaLEWme1ySLuk4jHzJLLsNKTF+caARFSBRWeMq2PDXWCT9gsprVVxCPo1S7SoX4wC99LVCDiViJvrxLVxvOTO4025BZT4vi7gRrTMZj4UyQmqZ/NZEcFzcMjEzxOOm5rCYUYlAblZ7fB6KEi7EmzWvbc= 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: DAMON sysfs files hierarchy on DAMON usage document is wrong about DAMOS filter directory. The directory has 'memcg_path' file, but it wrongly describes the name as 'memcg_id'. Also the directory has 'addr_start', 'addr_end', and 'target_idx' files, but missing those. Fix the wrong name and add missed files. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index ab343d6ac771..022f72cf5e14 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -89,7 +89,7 @@ comma (","). │ │ │ │ │ │ │ │ │ 0/target_metric,target_value,current_value │ │ │ │ │ │ │ :ref:`watermarks `/metric,interval_us,high,mid,low │ │ │ │ │ │ │ :ref:`filters `/nr_filters - │ │ │ │ │ │ │ │ 0/type,matching,memcg_id,pass + │ │ │ │ │ │ │ │ 0/type,matching,pass,memcg_path,addr_start,addr_end,target_idx │ │ │ │ │ │ │ :ref:`stats `/nr_tried,sz_tried,nr_applied,sz_applied,sz_ops_filter_passed,qt_exceeds │ │ │ │ │ │ │ :ref:`tried_regions `/total_bytes │ │ │ │ │ │ │ │ 0/start,end,nr_accesses,age,sz_filter_passed From patchwork Thu Jan 2 19:01:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13924853 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 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 \ + From patchwork Thu Jan 2 19:01:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13924854 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 72751E77197 for ; Thu, 2 Jan 2025 19:01:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 982E96B00F4; Thu, 2 Jan 2025 14:01:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9343F6B00F7; Thu, 2 Jan 2025 14:01:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7AB196B00F8; Thu, 2 Jan 2025 14:01:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 5CADC6B00F4 for ; Thu, 2 Jan 2025 14:01:54 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 23D18A02B3 for ; Thu, 2 Jan 2025 19:01:54 +0000 (UTC) X-FDA: 82963429668.21.ED2619C Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf12.hostedemail.com (Postfix) with ESMTP id 3EF8440014 for ; Thu, 2 Jan 2025 19:01:30 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=XlaCOO5r; spf=pass (imf12.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=1735844488; 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=Oxet0B41qryD0pnjgBlEoLG6FbAz4YTtMG8iCa+7H7k=; b=vKQ4stlADZgJ0m0C3D+5FUpQW2UROixbFejyIE3XqDy/XVipsj2Wen7sFk/g+knbYIF+Kv JPyk3LbzdDmLaDNoeq4cXC/tqiMUZpTROmoeRf2U5P6dirw1V+EWePctFCc5zrOgNBiE4+ 9G6g4NKhOmuVKnpgcWk5v+FmDEt6c+I= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1735844488; a=rsa-sha256; cv=none; b=ZjvgdRxwLDxvlasnxLJxszK9vmYd7dkGZbzdm2rBGn3dXSlzFL9rdCflEla+uctbhVWqNm vKDOaI79QxraUbnBJ4E4YUi/nNO7CIig9B6FgWlvPVDhAsz7465iIJuhJSsxxqNjdgBU1b DLv7vjV8mjq+PM6oedBj/BpGVfbwlhQ= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=XlaCOO5r; spf=pass (imf12.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 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 33BE35C61F2; Thu, 2 Jan 2025 19:01:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18B1CC4CED0; Thu, 2 Jan 2025 19:01:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1735844511; bh=Y1NV3w3Fvk/peP/cJXxwGprVnmhKsS9FZwzyPyCKXNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XlaCOO5rNn19HvIkCUNx1ojxpPoXV5gCSrJ79URuhc4SthOwBVX5GaPmmpbfCBST9 4wzNVnBEI+1lU5WNwV0TYHnnBEvI90xXCEblFhyjxNJqFNW6fDzuu+eE3x9EpFc3TT do8fW2RPtllMT+6IcYVaJI67yPSps96ROFY86k43IksroZBefuUqgjLsZJ/84FNuEL +ei8vdF1xdhTyHSB8cpemAx+l2y520q8yUFhSx8ZN2Gwpvh0tJtKrQ30jKphByKXZf vz5wR5xA5N2ICq5J6T3Kvj91ikIIGgxDGCV+Yq548AZhl6Ri7d4J3AuyElYT2SaoyN RvhJzPmVpbgbQ== From: SeongJae Park To: Cc: SeongJae Park , Andrew Morton , damon@lists.linux.dev, kernel-team@meta.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Yunjeong Mun , Honggyu Kim Subject: [RFC PATCH 5/5] mm/damon: explain "effective quota" on kernel-doc comment Date: Thu, 2 Jan 2025 11:01:38 -0800 Message-Id: <20250102190138.47258-6-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 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 3EF8440014 X-Stat-Signature: 7ubtkrpybfizrych9spgi5crdcc3ze59 X-Rspam-User: X-HE-Tag: 1735844489-120553 X-HE-Meta: U2FsdGVkX1/hsEL5D1PXKxSAWogSFopxMQMt//og9X/4G9YNREZQCzho5JG4k2JlJfCUgjijWIupoCKOGIHwqtiiREq45oMOjRacVfyupTKGIkArtF8/71KW7huCUXfdb98EnM5mULCTvCXBCcmP6eRVbsSO2FyqNarxLfywDBegcgYnw0WyKBNUyvVccZHwuH/fN+FhreCSLRfNM9Yp7noMahyTOlVJBWw2jG7fB6U9ek2ltBSIwEmq/gnL+yoC6ypmdsaYXVortHFlXFWcCVLGrfw1xLB88rortAMy4injolNxaa2suJoMw+hHg7/f27TgEvn8UpPb43I+F0mzjO8vOuGEobxR2Moa8BaguRHmPqmgnojcoYriDshigW/shtxKKV9RKAvw3CLEBuUdmqjEjZ6MOY5h4wIQ5nbRZTo+8Dhx0qQnqRIuu2fujlrRrAgaBBMh8Xky2X7vj/UrEK61XkjvXT6fOYY9ctZgh7DeBVMzn8rfB4RtjyN0b4E//RjLLHbtq7RJr0Rw/E0LH/OzC4tmxYwTr7CPoVNbuuNIMKEjKH5w9INrlH9FQNWOBgI2h9kYCJed0Z6pwkp8QILMcY7CQ7bmqo4WzPLZh4rAsIBTnqK9J0vbfFqVXr3jq55IdHBqvs+T277wSi0jkN/xe0x3DlvS2Fvp33tyam4DVp1m8hU/iIkIOu40G4JynzRhzUXDuj+Xw2UpiWMp+0q6+naY3K977tJKVDRA8RGwEBdgUdyq7Sfb7nzNVEWcKfrdvFmmxfrnEDPQwv92uUDKkzHla17SDc3xd9LAjf0CRT1evcOACUM/Iw4iUqnEE9kQuXrMb0TpweXHbbz38wiPGMsMay3mnoX+mgVTLX9nt/rbvfpYZeAtI8YljjdRdGE5gZmqKrH+e3C1G5lUxfat2Z5dDlMX+eex6rSdJTPf+c6P6s+EeyjU7bs2IzIIXMZi0S1Sgz2Z+APn5wL B3OOo2ao J6L1Jl0qYK52gynFXeJvBtLXzJJWq7hpUOuLB324rSQkic5gVIj1E9lADGSEMWJT/hHbwflfUoTbROoO0cfkGdg3gXbwfVihIqepYhm53EtFV3GONlOnqmzuTi4NMRe6IVGFFBKig8ehaAcS7Vg6NE0GheALFAN1LZAfAs4hQ6L5LUWPWxKLAeZXcpwyECGVUr8rbvzWc1tqPsON1prpbCO1Oeech2FKK9U7KkgGDtpLt7ejCqr4L9UQTXbkdILYHB8V+q0yjw/BVcQ9f/yW3p+jyymIg/pGNeg96yiKbYut1X7mmDLAU1gWQDsqZ8NycQkLP 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: The kernel-doc comment for 'struct damos_quota' describes how "effective quota" is calculated, but does not explain what it is. Actually there was an input[1] about it. Add the explanation on the comment. Also, fix a trivial typo on the comment block: s/empt/empty/ [1] https://github.com/damonitor/damo/issues/17#issuecomment-2497525043 Cc: Yunjeong Mun Cc: Honggyu Kim Suggested-by: Honggyu Kim Signed-off-by: SeongJae Park --- Changes from single-RFC (https://lore.kernel.org/20241126002921.50035-1-sj@kernel.org) - fix a typo and grammartical error (Honggyu Kim) - Integrate into this patch series include/linux/damon.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index ad0360711aca..ce477a0ed6a2 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -193,11 +193,16 @@ struct damos_quota_goal { * size quota is set, DAMON tries to apply the action only up to &sz bytes * within &reset_interval. * - * Internally, the time quota is transformed to a size quota using estimated - * throughput of the scheme's action. DAMON then compares it against &sz and - * uses smaller one as the effective quota. + * To convince the different types of quotas and goals, DAMON internally + * converts those into one single size quota called "effective quota". DAMON + * internally uses it as the only one real quota. The conversion is made as + * follows. * - * If @goals is not empt, DAMON calculates yet another size quota based on the + * The time quota is transformed to a size quota using estimated throughput of + * the scheme's action. DAMON then compares it against &sz and uses smaller + * one as the effective quota. + * + * If @goals is not empty, DAMON calculates yet another size quota based on the * goals using its internal feedback loop algorithm, for every @reset_interval. * Then, if the new size quota is smaller than the effective quota, it uses the * new size quota as the effective quota.