From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1BAA1A275; Thu, 12 Feb 2026 06:23:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770877408; cv=none; b=XM3b079VVuTlY8Qb5aEWGB8HlBNmQ82EmXOGxeig3Eahoa2TgGeVKn/oEcxmC+amp9t5bKUO5GOGaY4JP8GydA091deShuAZqx70JpBSJe/vx4pOm35EQHVnwKiqffa1pjKDstJa3+eP8wlM2saNBaFWNUSVrMrSa/z9pZbFe1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770877408; c=relaxed/simple; bh=UnAHQtsdX7p+D49YqSMSnEWB3831nfvi4I6dPZDhfFM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l6yvKAENgSvVwR22bT9IQC0Dqw26CmnL9e4qXP6dyx4UPABGMuHHfS7Jrc1gWutXEjbeX/pHLlHhslbGoB8CN/HeRayXtvPWIVRu5m3LgRqMb4F9b5VrdzfqYRBV938wFLdUVWhzPXTLbM2rsD7LTCWDWCsCWfM/q8D6e9LLoYM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pd+sLmUp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pd+sLmUp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9692C19421; Thu, 12 Feb 2026 06:23:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770877407; bh=UnAHQtsdX7p+D49YqSMSnEWB3831nfvi4I6dPZDhfFM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pd+sLmUpM+PD4V0GXXyk4YwJtLnBTXKa68QhML5DFMBULxaw5RGwWQuIzAOgPbcK7 cD+rA+9wVI9jqOu/ICCWjHI/UInjVN2+EWkfpleAvEXB45cDmKiz2ospLvAH41HrBC e7EyzK4vuTpnPksxKXmkAFNYf83bccDYLL48WnbI7b1YDQWV/okDFgQvybHjRXCbhs HqEWsE987AVU+AVqJAEHdn164zBoqDmrMCBoCLan+NnP2co882Zu1KEKx2QRVDCQPP XqC0G8Q6e6s/ENME6KNk+7Cz3WQH/l1QCZfIOn0mx6GYw9ojIDZB0F4agoIjPkE9/C 8i1+cjCd4MaZg== From: SeongJae Park To: Cc: SeongJae Park , Andrew Morton , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 1/5] mm/damon/core: introduce damos_quota_goal_tuner Date: Wed, 11 Feb 2026 22:23:08 -0800 Message-ID: <20260212062314.69961-2-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260212062314.69961-1-sj@kernel.org> References: <20260212062314.69961-1-sj@kernel.org> Precedence: bulk X-Mailing-List: damon@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Currently DAMOS quota goal feature utilizes a single feedback loop based algorithm for automatic tuning of the effective quota. It is proven to be useful on dynamic environments that operate systems with only kernels. But, no one fits all, and we got multiple reports [1,2] of cases that the algorithm is not optimum. Introduce a new field of 'struct damos_quotas', namely 'goal_tuner'. It specifies what tuning algorithm the given scheme should use, and allows DAMON API callers to set it as they want. Nonetheless, this commit does not introduce a new tuning algorithm but only the interface. This commit hence makes no behavioral change. A new algorithm will be added by the following commit. [1] https://lore.kernel.org/CALa+Y17__d=ZsM1yX+MXx0ozVdsXnFqF4p0g+kATEitrWyZFfg@mail.gmail.com [2] https://lore.kernel.org/20260204022537.814-1-yunjeong.mun@sk.com Signed-off-by: SeongJae Park --- include/linux/damon.h | 9 +++++++++ mm/damon/core.c | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index a4fea23da8576..25345b5f821b9 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -213,6 +213,14 @@ struct damos_quota_goal { struct list_head list; }; +/** + * enum damos_quota_goal_tuner - Goal-based quota tuning logic. + * @DAMOS_QUOTA_GOAL_TUNER_CONSIST: Aim long term consistent quota. + */ +enum damos_quota_goal_tuner { + DAMOS_QUOTA_GOAL_TUNER_CONSIST, +}; + /** * struct damos_quota - Controls the aggressiveness of the given scheme. * @reset_interval: Charge reset interval in milliseconds. @@ -260,6 +268,7 @@ struct damos_quota { unsigned long ms; unsigned long sz; struct list_head goals; + enum damos_quota_goal_tuner goal_tuner; unsigned long esz; unsigned int weight_sz; diff --git a/mm/damon/core.c b/mm/damon/core.c index 0ff190ed8a599..1c126d910fe62 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -405,8 +405,9 @@ struct damos *damon_new_scheme(struct damos_access_pattern *pattern, INIT_LIST_HEAD(&scheme->list); scheme->quota = *(damos_quota_init(quota)); - /* quota.goals should be separately set by caller */ + /* quota.goals and .goal_tuner should be separately set by caller */ INIT_LIST_HEAD(&scheme->quota.goals); + scheme->quota.goal_tuner = DAMOS_QUOTA_GOAL_TUNER_CONSIST; scheme->wmarks = *wmarks; scheme->wmarks.activated = true; @@ -860,6 +861,7 @@ static int damos_commit_quota(struct damos_quota *dst, struct damos_quota *src) err = damos_commit_quota_goals(dst, src); if (err) return err; + dst->goal_tuner = src->goal_tuner; dst->weight_sz = src->weight_sz; dst->weight_nr_accesses = src->weight_nr_accesses; dst->weight_age = src->weight_age; -- 2.47.3