From nobody Sat Apr 18 01:57:17 2026 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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=3DZsM1yX+MXx0ozVdsXnFqF4p0g+kATEitr= WyZFfg@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; }; =20 +/** + * 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; =20 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_patt= ern *pattern, INIT_LIST_HEAD(&scheme->list); =20 scheme->quota =3D *(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 =3D DAMOS_QUOTA_GOAL_TUNER_CONSIST; =20 scheme->wmarks =3D *wmarks; scheme->wmarks.activated =3D true; @@ -860,6 +861,7 @@ static int damos_commit_quota(struct damos_quota *dst, = struct damos_quota *src) err =3D damos_commit_quota_goals(dst, src); if (err) return err; + dst->goal_tuner =3D src->goal_tuner; dst->weight_sz =3D src->weight_sz; dst->weight_nr_accesses =3D src->weight_nr_accesses; dst->weight_age =3D src->weight_age; --=20 2.47.3 From nobody Sat Apr 18 01:57:17 2026 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 612C2288C3F; Thu, 12 Feb 2026 06:23:28 +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=RGmc5x6L7l1D2s+6+IuoNcTftkpUkRsODetjqyuN5EOvn00VGK/rhOSSHwTX4v1lY1lVruBTvzJVBVY+XOplVp8S0Qo3R0WGlouzxyab31izC2j1eAE5kflSK7Euw8uEsgR8c4pt7+fFMSbP+ekNrj3fdDgsVcgrgXZz4z2yIzE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770877408; c=relaxed/simple; bh=xBnWOLA3jQha94wtKmplmtV31fbSm+0D4iTTXT4bhss=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eOLT8XqKSqRAxW6LrnxWRYOSaEaP9GgZQVlu9eIL60dQ13WheEo+Fk1MQsbQPpcCzG3zwBRAm2WsXmxUePXTpQCKCVHPW/CiDSf/xhXEmbBl83Vlhu4sfTmoiG9Tz518l/vukmbdAdEk9yQRzW44a9RGK5IJc85TigX3VZFRHhY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uX2H8Edy; 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="uX2H8Edy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE967C19424; 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=1770877408; bh=xBnWOLA3jQha94wtKmplmtV31fbSm+0D4iTTXT4bhss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uX2H8Edy988IOxMIf2SQzORS/zRaP3jk2oBvJ5/+z5Q0wCotlw/MJFcbDFIeyBFpm 6i8bnUQgHNg50YB2KCdUQi4ELfK18ixbsBsSOVtMhJ+FY936JdFK/w8XtLsYYue3uH 4//ekEpbJvOKwmSIK/1tPGqQQ1wV5z1LbMbMP0SAX/leLjTCqlCdYymI3T7aPkTVfJ xJyQQw2pOLpdtyUmlTHFPYR3/EL99gJ+je0wVCDz7xV1sh3qXfCj0VeIjan03GNzQG jGOXay6lmU+8t5bX7FOHhzF8SzEJ+yo31JRO7GPAECesPDfAJhHzyJvvT04MpgY3m/ /ydOGkCaYyltQ== 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 2/5] mm/damon/core: introduce DAMOS_QUOTA_GOAL_TUNER_TEMPORAL Date: Wed, 11 Feb 2026 22:23:09 -0800 Message-ID: <20260212062314.69961-3-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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Introduce a new goal-based DAMOS quota auto-tuning algorithm, namely DAMOS_QUOTA_GOAL_TUNER_TEMPORAL (temporal in short). The algorithm aims to trigger the DAMOS action only for a temporal time, until the goal is achieved. For the temporal period, it uses as much quota as allowed. Once the goal is achieved, it sets the quota zero, so effectively make the scheme be deactivated. Signed-off-by: SeongJae Park --- include/linux/damon.h | 2 ++ mm/damon/core.c | 29 ++++++++++++++++++++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index 25345b5f821b9..0ab247fb06ca8 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -216,9 +216,11 @@ struct damos_quota_goal { /** * enum damos_quota_goal_tuner - Goal-based quota tuning logic. * @DAMOS_QUOTA_GOAL_TUNER_CONSIST: Aim long term consistent quota. + * @DAMOS_QUOTA_GOAL_TUNER_TEMPORAL: Aim zero quota asap. */ enum damos_quota_goal_tuner { DAMOS_QUOTA_GOAL_TUNER_CONSIST, + DAMOS_QUOTA_GOAL_TUNER_TEMPORAL, }; =20 /** diff --git a/mm/damon/core.c b/mm/damon/core.c index 1c126d910fe62..81e3ef737be77 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -2217,6 +2217,26 @@ static unsigned long damos_quota_score(struct damos_= quota *quota) return highest_score; } =20 +static void damos_goal_tune_esz_bp_consist(struct damos_quota *quota) +{ + unsigned long score =3D damos_quota_score(quota); + + quota->esz_bp =3D damon_feed_loop_next_input( + max(quota->esz_bp, 10000UL), score); +} + +static void damos_goal_tune_esz_bp_temporal(struct damos_quota *quota) +{ + unsigned long score =3D damos_quota_score(quota); + + if (score >=3D 10000) + quota->esz_bp =3D 0; + else if (quota->sz) + quota->esz_bp =3D quota->sz * 10000; + else + quota->esz_bp =3D ULONG_MAX; +} + /* * Called only if quota->ms, or quota->sz are set, or quota->goals is not = empty */ @@ -2231,11 +2251,10 @@ static void damos_set_effective_quota(struct damos_= quota *quota) } =20 if (!list_empty("a->goals)) { - unsigned long score =3D damos_quota_score(quota); - - quota->esz_bp =3D damon_feed_loop_next_input( - max(quota->esz_bp, 10000UL), - score); + if (quota->goal_tuner =3D=3D DAMOS_QUOTA_GOAL_TUNER_CONSIST) + damos_goal_tune_esz_bp_consist(quota); + else if (quota->goal_tuner =3D=3D DAMOS_QUOTA_GOAL_TUNER_TEMPORAL) + damos_goal_tune_esz_bp_temporal(quota); esz =3D quota->esz_bp / 10000; } =20 --=20 2.47.3 From nobody Sat Apr 18 01:57:17 2026 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 6337728BAB9; Thu, 12 Feb 2026 06:23:28 +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=ViAglT6CJxijlCo0YBNW4klmFbMS+WYBqY/FuPMz9xbojS9QSB+yqVLS21Fah7FSinp3sxd3uGncsMgftQJi+t+6a6YbdHY7Vgpan5fvbaCJ6vZ2pNrupqHwUPVIOUMUoO92r2hbamLRhPI4AyEnCrs1R81x7UpSOygbNXqxwrA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770877408; c=relaxed/simple; bh=K7N0OnHx6SU/UFHKtEBzt5r26kfuQxAuPfXTSNUkEbQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kIVvzn6BMsA5zEMGRzSOHrq5xK+jC+BdpD3unUqAAKd9DNtJJYBxZc2lC2npvqa31Un9u/vOr0S8C9vdvejSlF+obMbfiUbLhdiexPgHkXG3eb9MDDPFEuw62AYyJuywyeetvfDGCzt9tFsIHHUqXGwF+UzYqAwuonLARhk+8Dw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=u6eqUhu5; 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="u6eqUhu5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F9A0C19421; Thu, 12 Feb 2026 06:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770877408; bh=K7N0OnHx6SU/UFHKtEBzt5r26kfuQxAuPfXTSNUkEbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u6eqUhu5Pb1SeEwzxPLxiEKY2W2TNF/CekmBWoPuOPMTVJQU/Ec2DulNPSiDhNalC SaZDYe+AaGycq3IQAAi02BeHN/A67aygGAEdTb+dmqrMpEvZ5VrvdRmbjXb8dLzojZ ooVm2TG/EC/kNr7CRvf8KWwTtCWsNk/M8TWnh5zbnfG5tKti9SIBTCphFarAeJMmjm 2fJS45jZfbf5yO51iajk27Vdid9mbM6Qnyzeazd28GGQGySaHqYAhvc9T5JcnV6k5D r/VdZISAjGoDiLFmydism5dM8IhCivD+z/ynuVDqtQFRBI6kLxGY6VernWp6Mxepv/ M7GvRggOFAUwA== 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 3/5] mm/damon/sysfs-schemes: implement quotas->goal_tuner file Date: Wed, 11 Feb 2026 22:23:10 -0800 Message-ID: <20260212062314.69961-4-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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add a new DAMON sysfs interface file, namely goal_tuner under the DAMOS quotas directory. It is connected to the damos_quota->goal_tuner field. Users can therefore select their favorite goal-based quotas tuning algorithm by writing special keywords to the file. Signed-off-by: SeongJae Park --- mm/damon/sysfs-schemes.c | 58 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c index 2b05a64771884..b30d9139b1c23 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -1492,6 +1492,7 @@ struct damon_sysfs_quotas { unsigned long sz; unsigned long reset_interval_ms; unsigned long effective_sz; /* Effective size quota in bytes */ + enum damos_quota_goal_tuner goal_tuner; }; =20 static struct damon_sysfs_quotas *damon_sysfs_quotas_alloc(void) @@ -1614,6 +1615,58 @@ static ssize_t effective_bytes_show(struct kobject *= kobj, return sysfs_emit(buf, "%lu\n", quotas->effective_sz); } =20 +struct damos_sysfs_qgoal_tuner_name { + enum damos_quota_goal_tuner tuner; + char *name; +}; + +static struct damos_sysfs_qgoal_tuner_name damos_sysfs_qgoal_tuner_names[]= =3D { + { + .tuner =3D DAMOS_QUOTA_GOAL_TUNER_CONSIST, + .name =3D "consist", + }, + { + .tuner =3D DAMOS_QUOTA_GOAL_TUNER_TEMPORAL, + .name =3D "temporal", + }, +}; + +static ssize_t goal_tuner_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + struct damon_sysfs_quotas *quotas =3D container_of(kobj, + struct damon_sysfs_quotas, kobj); + int i; + + for (i =3D 0; i < ARRAY_SIZE(damos_sysfs_qgoal_tuner_names); i++) { + struct damos_sysfs_qgoal_tuner_name *tuner_name; + + tuner_name =3D &damos_sysfs_qgoal_tuner_names[i]; + if (tuner_name->tuner =3D=3D quotas->goal_tuner) + return sysfs_emit(buf, "%s\n", tuner_name->name); + } + return -EINVAL; +} + +static ssize_t goal_tuner_store(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf, size_t count) +{ + struct damon_sysfs_quotas *quotas =3D container_of(kobj, + struct damon_sysfs_quotas, kobj); + int i; + + for (i =3D 0; i < ARRAY_SIZE(damos_sysfs_qgoal_tuner_names); i++) { + struct damos_sysfs_qgoal_tuner_name *tuner_name; + + tuner_name =3D &damos_sysfs_qgoal_tuner_names[i]; + if (sysfs_streq(buf, tuner_name->name)) { + quotas->goal_tuner =3D tuner_name->tuner; + return count; + } + } + return -EINVAL; +} + static void damon_sysfs_quotas_release(struct kobject *kobj) { kfree(container_of(kobj, struct damon_sysfs_quotas, kobj)); @@ -1631,11 +1684,15 @@ static struct kobj_attribute damon_sysfs_quotas_res= et_interval_ms_attr =3D static struct kobj_attribute damon_sysfs_quotas_effective_bytes_attr =3D __ATTR_RO_MODE(effective_bytes, 0400); =20 +static struct kobj_attribute damon_sysfs_quotas_goal_tuner_attr =3D + __ATTR_RW_MODE(goal_tuner, 0600); + static struct attribute *damon_sysfs_quotas_attrs[] =3D { &damon_sysfs_quotas_ms_attr.attr, &damon_sysfs_quotas_sz_attr.attr, &damon_sysfs_quotas_reset_interval_ms_attr.attr, &damon_sysfs_quotas_effective_bytes_attr.attr, + &damon_sysfs_quotas_goal_tuner_attr.attr, NULL, }; ATTRIBUTE_GROUPS(damon_sysfs_quotas); @@ -2726,6 +2783,7 @@ static struct damos *damon_sysfs_mk_scheme( .weight_sz =3D sysfs_weights->sz, .weight_nr_accesses =3D sysfs_weights->nr_accesses, .weight_age =3D sysfs_weights->age, + .goal_tuner =3D sysfs_quotas->goal_tuner, }; struct damos_watermarks wmarks =3D { .metric =3D sysfs_wmarks->metric, --=20 2.47.3 From nobody Sat Apr 18 01:57:17 2026 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 CB54D298CC9; Thu, 12 Feb 2026 06:23:28 +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=JtOws2R5d1+Y+BDQNNyCzz8f9YaUm1XAWmsv/PGEwNBFAzYmvbtEsCO860cUgl2AR6bcO6sp5wNp1bwBTYTaxAnXQyy+yxJkHFzLscTuL5aggDVlRseDNFFCKgHJMAzMD738p2k6gzGhxknJsww0os7K8RA/HXO/vz591bWw2c0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770877408; c=relaxed/simple; bh=GAZRnbykPH7suqW/p1IoZkedLjJYjMBqsndjLOFppz8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CwzDFPU4bU5UX2TuRvSximU6bjya2R5+ucqmgjklBB2BEA3J6z1vxqY9uCfck2L+IP6GqKflMGcPcWXM1a8zRyOMq5ZYc+e+njPtaFerR5vEHwPYihFMyltAWSSLwhHpedFc6MDSyViGSdviMLBYO9UkPmt1NuNtsucnQofxBNE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oC+OHmvl; 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="oC+OHmvl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65B2FC19425; Thu, 12 Feb 2026 06:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770877408; bh=GAZRnbykPH7suqW/p1IoZkedLjJYjMBqsndjLOFppz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oC+OHmvlIsLuQBDFuJTf1WEQZ2+T73xoCBHqM9yBl1BWk9WkqzD31TEh36iQQaLlQ xUT06+w7g/gPnavr+zzH9zg+ikJnLdw5AL7WL0XLv7tEi1q/jaZF4pS2Pb5P/0Ahg6 ieipUMaR/SLwWF/EKz6hZa4MzMb10vk8maBVAHbDFFTQlcseiPpRtJS76qbzRqFCeC WkRWGw00OdOTgdnz3jxLYBzdt95rOX8C7CJ6MIo/OPdg6odHy7V5cJlCvRLPKuRjQJ kux6HqxX95Mx8H7IBN8CHqUJFqh55ye9ZxF5reGdzy9ks+i8ReXhs7hNA+nmPB23Jw X1NAkx8wk4uFw== From: SeongJae Park To: Cc: SeongJae Park , "Liam R. Howlett" , Andrew Morton , David Hildenbrand , Jonathan Corbet , Lorenzo Stoakes , Michal Hocko , Mike Rapoport , Suren Baghdasaryan , Vlastimil Babka , damon@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 4/5] Docs/mm/damon/design: document the goal-based quota tuner selections Date: Wed, 11 Feb 2026 22:23:11 -0800 Message-ID: <20260212062314.69961-5-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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Document the newly added goal-based quota tuner selection feature. Provide the list of the available tuner with descriptions of their behaviors and when those can be used. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index dd64f5d7f3193..28d932ceaf7ed 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -564,6 +564,18 @@ aggressiveness (the quota) of the corresponding scheme= . For example, if DAMOS is under achieving the goal, DAMOS automatically increases the quota. If = DAMOS is over achieving the goal, it decreases the quota. =20 +There are two such tuning algorithms that users can select as they need. + +- ``consist``: A proportional feedback loop based algorithm. Tries to fin= d an + optimum quota that should be consistently kept, to keep achieving the go= al. + Useful for kernel-only operation on dynamic and long-running environment= s. + This is the default selection. If unsure, use this. +- ``temporal``: More straightforward algorithm. Tries to achieve the goal= as + fast as possible, using maximum allowed quota, but only for a temporal s= hort + time. When the quota is under-achieved, this algorithm keeps tuning quo= ta to + a maximum allowed one. Once the quota is [over]-achieved, this sets the + quota zero. Useful for deterministic control required environments. + The goal can be specified with five parameters, namely ``target_metric``, ``target_value``, ``current_value``, ``nid`` and ``path``. The auto-tuning mechanism tries to make ``current_value`` of ``target_metric`` be same to --=20 2.47.3 From nobody Sat Apr 18 01:57:17 2026 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 3E9EC29BDA1; Thu, 12 Feb 2026 06:23:29 +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=1770877409; cv=none; b=JOwUcV1slSBOVo2n+EuKDFPnXDFxXhLd14/g8NBO4gAhdwUquPF826QSaNYLc0oHpzsSIQKwdmggNU4MKIMbLFac7AYBGUlhod51vsvYRPR2MmsVBHhRmMkTf7vw/qGlP6a2YTZDUBgId96P5DksbbAYM0Ij0Kp/rLNFg1m01pI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770877409; c=relaxed/simple; bh=3t+rELlNfEbmM15iobjCBnl0Dkhx8Jvwm7r3C6rWDgU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YW8LJ0MKy5UKcfItV/NNd6vJI1TXJ/w8e36+owV3lxtI/RJpotok+ofBUE0PF8bvkucdv1S6BHFHbK3xUPa6SrDBevcO1S6njwhXdwwolGEB3vcKBWa0awCEGSVN1osDuxi1HYk6BcgEzX+4JHwAWmMJgAuFI+g03eRChMZYaOE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=By3XEsyI; 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="By3XEsyI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4DAEC2BCB3; Thu, 12 Feb 2026 06:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770877409; bh=3t+rELlNfEbmM15iobjCBnl0Dkhx8Jvwm7r3C6rWDgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=By3XEsyIi/Qy6nLUNYymsrk5jw7Stkt1Yl3jZB1f26MwD46tQGrjfM7FkdJtkPswR 0msE43fqVBh5RAZbXopyhrOTtsK+C8+/BQFw/7lVJ9rWBkkf48I/ftZlkOloBNN+du NSTFrCC8Ugk1aPQ3EvIzYHHOM+PxbRuDtxGz2K3TqWmsyg4Yt0z0/00tzFWt8FiOCN EE380K0XQBx+Cp1ihSYpQhWm6EuaK0EoKODa1o/BVpKtuhKwxNd3sQs1gHsSpmEBdT mgklbX9OG70ow5ae4xVgEoVQ51dv+fyL1KPUYCpIbA6ZUYWsl9hHdN7Xnjk4ECyfdn 8lZBW+IJAF5/A== From: SeongJae Park To: Cc: SeongJae Park , "Liam R. Howlett" , Andrew Morton , David Hildenbrand , Jonathan Corbet , Lorenzo Stoakes , Michal Hocko , Mike Rapoport , Suren Baghdasaryan , Vlastimil Babka , damon@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 5/5] Docs/admin-guide/mm/damon/usage: document goal_tuner sysfs file Date: Wed, 11 Feb 2026 22:23:12 -0800 Message-ID: <20260212062314.69961-6-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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Update the DAMON usage document for the new sysfs file for the goal based quota auto-tuning, 'goal_tuner'. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/a= dmin-guide/mm/damon/usage.rst index b0f3969b6b3b1..534e1199cf091 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -83,7 +83,7 @@ comma (","). =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 sz/min,max =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 nr_accesses/min,max =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 age/min,max - =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = :ref:`quotas `/ms,bytes,reset_interval_ms,effective_bytes + =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = :ref:`quotas `/ms,bytes,reset_interval_ms,effective_bytes,goa= l_tuner =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 weights/sz_permil,nr_accesses_permil,age_permil =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 :ref:`goals `/nr_goals =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 =E2=94=82 = =E2=94=82 =E2=94=82 0/target_metric,target_value,current_value,nid,path @@ -377,9 +377,9 @@ schemes//quotas/ The directory for the :ref:`quotas ` of the giv= en DAMON-based operation scheme. =20 -Under ``quotas`` directory, four files (``ms``, ``bytes``, -``reset_interval_ms``, ``effective_bytes``) and two directories (``weights= `` and -``goals``) exist. +Under ``quotas`` directory, five files (``ms``, ``bytes``, +``reset_interval_ms``, ``effective_bytes`` and ``goal_tuner``) and two +directories (``weights`` and ``goals``) exist. =20 You can set the ``time quota`` in milliseconds, ``size quota`` in bytes, a= nd ``reset interval`` in milliseconds by writing the values to the three file= s, @@ -390,6 +390,14 @@ apply the action to only up to ``bytes`` bytes of memo= ry regions within the quota limits unless at least one :ref:`goal ` is set. =20 +You can set the goal-based effective quota auto-tuning algorithm to use, by +writing the algorithm name to ``goal_tuner`` file. Reading the file retur= ns +the currently selected tuner algorithm. Refer to the design documentation= of +:ref:`automatic quota tuning goals = ` for +the background design of the feature and the name of the selectable algori= thms. +Refer to :ref:`goals directory ` for the goals +setup. + The time quota is internally transformed to a size quota. Between the transformed size quota and user-specified size quota, smaller one is appli= ed. Based on the user-specified :ref:`goal `, the --=20 2.47.3