From patchwork Fri Jan 10 18:52:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13935394 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 74C2FE7719C for ; Fri, 10 Jan 2025 18:52:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EFC158D0010; Fri, 10 Jan 2025 13:52:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EABB18D000E; Fri, 10 Jan 2025 13:52:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C88D68D0010; Fri, 10 Jan 2025 13:52:48 -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 A3FAF8D000E for ; Fri, 10 Jan 2025 13:52:48 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 693EA80E16 for ; Fri, 10 Jan 2025 18:52:48 +0000 (UTC) X-FDA: 82992438816.26.48818DA Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id D05D5140011 for ; Fri, 10 Jan 2025 18:52:46 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=nOJStIW3; spf=pass (imf09.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=1736535166; 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=SaaWyyv8li+dteHijC7o/yJUzsQm0EvRgS8tQ52mNqc=; b=6GzW3HaV3X2tjv7hdI/+7meBE+ypggi37a6tMJ0ZoV5Vm0po4QMWwnGwlegACcsEmCA574 eRBrBF+xNJ9vjPrtfumUF8CRZH20VJruh2xJOHUIi5d67PFXW0wHkHyYnaYgjqEAkHIijV gjPp7oeHg5wmNJzuGt8mwg7+uCKiTAk= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=nOJStIW3; spf=pass (imf09.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=1736535166; a=rsa-sha256; cv=none; b=VT5ZGwVoBQlN7CEjSGXre7DaoOpJRrVszT8Y14PP8vMkvst2CbPPgPwWhIbcFbt8lvdO0i MEx42So8Moadwo/EOhkOSTPbO77WlLCvbXDFK2A7Gb+YbStK69RdBvW2VJQYKz4LfYJxFu 6ySmTg0AHrTbojbdxDvYL3glbqyGFIA= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 213BD5C5690; Fri, 10 Jan 2025 18:52:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E14BC4CED6; Fri, 10 Jan 2025 18:52:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736535165; bh=cNUCy0TlSD/d2Pmdsrm3XmKc2hpQgSkhrpqQ3/ahDso=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nOJStIW36CNd5fyaROhH7XAA105UoPMXTv3X5+3gEdRxdL8roGa7Udmi7qjQ091Vh 10qDvazBoYzxsVrclJ/LLeGyN5fLO6pW/zOd3W9bZ8BXBLdw5qitUDZIKi9w0ydLZS 5u8jraLrBtSVYRe87G2EB0o28LyTX7sqb3hUNfVBJDYUFiAORjeQKEu0OG0wwXHmyv 0A7iUOtXZZMhDLQym8FXdIRcj2XKwQi+ZvfDC84+gvcn/spWfckXIj8DU5JTvHTyqg kE78jbwpINmyDpsOIudJNDFxrpQHyaZaVnZkNwQkpiLPjjXEIR8CKQ2f8ksWky8oI8 QAkSwCkBs4ooA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Yunjeong Mun , Honggyu Kim Subject: [PATCH 5/5] mm/damon: explain "effective quota" on kernel-doc comment Date: Fri, 10 Jan 2025 10:52:32 -0800 Message-Id: <20250110185232.54907-6-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250110185232.54907-1-sj@kernel.org> References: <20250110185232.54907-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Stat-Signature: uheknxbudrguoq18m1dzesgycdhbo5bh X-Rspamd-Queue-Id: D05D5140011 X-Rspam-User: X-HE-Tag: 1736535166-527695 X-HE-Meta: U2FsdGVkX1+ncfiFd98tK8AOf4jYdOrkrQ1nS3H11+WPYS1rWZ6pUL8GDYCuxoyfYYuJPHlZ+ML7J2neiXdDlyrTfvqhp0AfP3dmeh47GZ+MU2uEvZ9SZ66+z6sK25J65/E0sn+zpBiiZ0VEY8Kz7cIdynOzHFUbuRUpHCHTBdLNUg36ZRr9kMyBmdz8jAPZoBUPQ+dTOGMfI7xLPdfCV6qfBuE/wP1M+1CWIo5Tk7TG4rdM0/v9CQ2QUHZDEsV/0aCZ7fzV+1N+y6GGcdN/7a+WYC/+Di/NJzXzqpaheSxkTPNhmZLCQtRPGYYg6er8+zaW0cPin8uvbCniStsB6Iw51jgYPYzhczfALZQ25EUN7uCST10UO51y1+7govzkfP0JggK0XmWo5fr9JWWCaEh3wbkF9ekK4MI5bBilM/zzNYsZiO4ITM935Ejsto3VWUOm5hfaNA24dEalcQQp0fIn76qQpjD4kdxXz21d/5CfjulOBHji5yDQAd9KmGxIPEn/mzoCGPhMbgrVMqGXUse2bqNOafl/PEKpCSt8Yj/tvjD3ZvQXssST1XEpBg9HbiUVb4mOF+OZKN1r4k6Qr/3VBeEVXXieQIxKzOEK2q1Kr/RSdZT4wWEj3aLEbk6Kmhlxd3RUKmNx75Ik62GouOcnuLjN5JhH4nj33/rCN1EsJq/Nu4n/MwBJpaCcA0dh38rGoA5BacSGwTkEzsAiIYIQsiUdztsRmtEh+kxAJsO6eaR/gCzz7gD/7JsD4pRZQnTs4dnWGR8OjwlyUrys9RJ82IyhAkOQUfY1uaJoIH10wm8Dgw1p9m1eRkllGsoR+4e8vmGIfHSOlxE6yfP/EfRicfaKsXcts1+D+e/X2cZeRv7YQKY3ZUWlUg5xmVRwQUl1Kzzjpn+fP7fdEeI1qbT3xWtnJBUDbRrvQcE6eFpLKpbROAowaxxRpCTLtUozppqS0k0MBkCB3dp0nbs y8cohrwD cRluYUniA64ibtyxl5cYBcKckDlyIMUlbiyP/OHzhN9YSFDnOGk6rLkzQfELFmoLSq3WPb0d9zCLfNhO0QrQ9hy9WiIqB1/N38PCkxHkvpi0M9wzLcWm/4to8wv6QatozRPvD8+pFdqfc0ciMXgCu4vGs67uWqYlXagMYgQJRYNTcJdMojOlYmj4wSxyJzfBeTCJwhyV+bRBtI1c95e60IpfY9/M+wyZwfW5X1kZcat4eo1Bd6D280bn4a7RreQ5bRW72gNDtz/vqBfLY5xmj8zpXN1F62Xl3qUz9QGds6k9pjpgx719TXyXn+Q== 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 --- 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 0834d7ffcb84..af525252b853 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.