From patchwork Tue Nov 26 00:29:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13885373 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 67AA9D59D80 for ; Tue, 26 Nov 2024 00:29:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B9E696B0082; Mon, 25 Nov 2024 19:29:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B4CE86B0085; Mon, 25 Nov 2024 19:29:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3C9A6B0088; Mon, 25 Nov 2024 19:29:27 -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 897106B0082 for ; Mon, 25 Nov 2024 19:29:27 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 38A891C6534 for ; Tue, 26 Nov 2024 00:29:27 +0000 (UTC) X-FDA: 82826362164.03.89D53EF Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf11.hostedemail.com (Postfix) with ESMTP id F073E40007 for ; Tue, 26 Nov 2024 00:29:20 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mU0nAuGH; spf=pass (imf11.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=1732580964; 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:references:dkim-signature; bh=xEzZpCkH9Tjg7yKWinAHYNgkCgeRL5IIYzaNpWBX9W0=; b=tecBXfuTLCLwl12qbzgkvOE4JJDFDgWLC+Y+I9twvsizccuhRxlBGWITPQtR4GTFu2EfDY gBdeVTZx6F8bIF4xd9K+ZpXII8VNxriREhqpdzlQwCufCsYAeFfCkhCsr88C/+rjulEx3Q IjMMBKLur8+KE3CT2Clev7I22SoBUi0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732580964; a=rsa-sha256; cv=none; b=Y9ODMB3vrs/TMQZCXZg2uFo45PmPW9dAd3gicj+DnYLVdoPS4Y3wM4Kkn+26SLCUMqg0ZM aS3rZjZAjRgRHSyt4bc1VNT727OgUKYEqQM0/MUSupkCSHXFMhRN80lrjJiZPIRmS4GOvc M9QB1Xir9k+Dq7e4WA2mdegJtYI+kfU= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mU0nAuGH; spf=pass (imf11.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 B470FA41974; Tue, 26 Nov 2024 00:27:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AB77C4CECE; Tue, 26 Nov 2024 00:29:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732580964; bh=f6ufFFbST1iK9JOmRgVJyaZ4psK01QmjedArsoSNU7Q=; h=From:To:Cc:Subject:Date:From; b=mU0nAuGHkTCe/pKN7RpZ06upTbIPXse6VXfFkrfkN3xqYGRE9k30Od1qgpQuT1Bp0 iKAKktDZto3xSIfEbN6B2WX3itJTqU+WDAbdyKU/6n8zyGTrHSRSi5L9wN/mUdTcKl PZPT2Kf4K3rYEVMzk66XovJAkfZo641jc4dHHlALUPKnrn4c83TKJhsmw/7Eu3Z4OY 6OtpmlqSinDTKqyeEECp9vJwVoweuWrxJbM5iboF8IoSz0+H+gymy3V0ok50DepK9n Ws0wbwLcddBXaTWRWwH0+3pU/hmzTmLGrZN1vfeGKeCKMfXeoeKYoY4HvPlhx5ADui rfrj9bioGWgAQ== From: SeongJae Park To: Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yunjeong Mun , Honggyu Kim Subject: [RFC PATCH] mm/damon: explain "effective quota" on kernel-doc comment Date: Mon, 25 Nov 2024 16:29:21 -0800 Message-Id: <20241126002921.50035-1-sj@kernel.org> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-Rspamd-Server: rspam10 X-Stat-Signature: ktti4z4hffxue9y3e7y8xraz3nqyamko X-Rspamd-Queue-Id: F073E40007 X-Rspam-User: X-HE-Tag: 1732580960-626359 X-HE-Meta: U2FsdGVkX1+ED6BcBor5vMlaYXVjbkoY4LtP75eCsjA2kTbfS+3pckfN8CfX7C/3SkO5KEUXSqdq2qN0Wh9J2+WXnq7zMp9gEQ26n4mpVWjyLMHYy4d0snCET5+LIm2U9qh/9FX9LTt3qd8a6j86y67ywQwabu4nV8AEcIPmOiN7YEOEaUrmkqrbROr6rsQq69lF0E0eLkZUejUIquyI2/rHdVh2skdllawgijzaJ3gAhsWJVNYvdPjCQpWmckDvcG++YV7nfWJkNW0OEPCcvYw2d54JoPJGR24Ys6U7aeCY8/GRm5P64lUynLMHPCUP75keQGw0+q6+RzfOUQPePk9D9wxdIfiEs+fbXCgfuyX/lNFLFnj3V3osmZhyzvlEqa3GFq2UQXW0WaqQKdyNXM1lD/ySe/gJjezTAR3Dqo2NU/s7sE60AFZY0GzkFSnV8Gcr20FI6t19UIznRHMYhDjcXhEAU6KV7V1hVcAx/mQUOy3I+wQYMSjFzh1mrX146b9BosyzcxqUF1vqNoiUuZ5FZwIXygxHNKVedN2i3DzGxmGkWof3ParYnFKAl0KG5XvsSH8wcapGYkQgIK/7VKha7rlddmfg0OmX7u1cOdiFjvyCMb6Ds3+2FrPmk4NGCbeUh7CsWPVG4PZ/nQL0YDGqICEpQ0DaUkljvjILRoSOWJ1wwEse0mRbUr6rr3LZTNfbO/FvQFKo5JRhq8nNSnh5qYVm+9sie9JIdbCL6W9z+ViKSr0QEYmFVy7mOfM3Ui7yaiJSIcCgu5SgPH1T0lJWlYCxf11j9Cu4zcX/+AoyijjSuF3D+k2hs+i53PbzaGcTy1zYYwNeFcs9TjgEYSD5htKeFj0Hsc+QExMvhzc/IjKdPHDgqr+K2U9JFbeLpGL87l9D6OeBnvFwjs/1RomDV0n6v8ibvU/GtYuDwVQGclCFXDuDZG/gBBmwgYYRIOns4BERTZDe74GY/EW KfcevQae ZSYl/lfr0N4UIhFhRMNugTmedI8g56pVzveORZ5yKpjwRLZtxfcroCI44eF/G3iVErpszv5FihwWQ35K9Xd4U5Vte9urxOZFfmQC3WmGvrOXjBBSKchcDdXl7roHCSqHD1fnoI6uBlue5+TiREJ2Cf78s7zVjQ7boUkDKgH7Hgfl1gi7NgmnnSpQdrpQwquEBD22qLm//qZYduyPAqW/lUUh0pQmNJiHSKZKoCxbH3t0AKTMpNg1MP6Y/F7kc7xYZDK4/ami85AXFd70pryZHX5Qz6w1nc+gWpQDoaj60NqqFPUX9gZyR3ZdlBA== 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. [1] https://github.com/damonitor/damo/issues/17#issuecomment-2497525043 Cc: Yunjeong Mun Cc: Honggyu Kim Signed-off-by: SeongJae Park --- include/linux/damon.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index a67f2c4940e9..a01bfe2ff616 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -193,9 +193,13 @@ 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 only one real quota. The convert is made as follows. + * + * 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 empt, DAMON calculates yet another size quota based on the * goals using its internal feedback loop algorithm, for every @reset_interval.