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.