From nobody Thu Apr 9 09:01:31 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 3D4463090CD; Tue, 10 Mar 2026 01:05:39 +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=1773104739; cv=none; b=rUnADUit39eXvn9cwERiIyG/wDnxRnmpcQYPpu9zKungNHwdMBIhKYxH1mQ86sWi7nOKYDa06L8EAPdQlYIImm/UIpIcfD3y/H5TZPDoa/MwyGRqRTMDegriIN8dTFIuzWqKkpXBNU6Bd77+Ua8KmuHZYkf4471XnYgtWzfhvaw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773104739; c=relaxed/simple; bh=W0GRV5F589US37sVLvkk1Bm1kqbNZSMw9lB8rWD8J94=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JTSzomxkbGnOdQE4IwgprhARcGIkxxPWm2JPhyYinU97YXwIJVQgYCOLXGAWf5/TwDeUVdYFz4wxbQpSxE+DeVrxqcqpe7/7a9jAS6BNEy0AIq2lqgskTl/ZD4uxljrwUamOE8pxG0JY9FQIgkpemslNo3zIMtjouOkwj95OA2I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iORzpayA; 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="iORzpayA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA37BC2BCB1; Tue, 10 Mar 2026 01:05:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773104738; bh=W0GRV5F589US37sVLvkk1Bm1kqbNZSMw9lB8rWD8J94=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iORzpayA5JVsAcGY6WLC+PT/svxnei6p5HhGfHcPGw2BhBI8aRven308Howf2gxTx URE7TlvcPeHjA++/hfqHSWDDDW2YwvTVUoNbwa13buAr5ipqS/AIJ48DnoSHqN5fPI 5eGUn1zxw/Ujzi7ZmxLDf3NZiz/1WckzC/mfJDVxnJhnfzRWb1xdqFor/mpcYQh52+ Yi2w3oRRiijnlbtEcwvkxcMYIjNNdSbibjD5ET6bBpXsZpRlZ9zzVENzQm1kbZ+wiE wvI4D0gZp8eZuqWs4Dq36qAfdEIoHS/4LCzxpXrsNMGghYLk5i4Cmpn24+GHk7Y/lB +9zH0gkGjEX2g== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 01/11] mm/damon/core: introduce damos_quota_goal_tuner Date: Mon, 9 Mar 2026 18:05:17 -0700 Message-ID: <20260310010529.91162-2-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260310010529.91162-1-sj@kernel.org> References: <20260310010529.91162-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" DAMOS quota goal feature utilizes a single feedback loop based algorithm for automatic tuning of the effective quota. It is useful in dynamic environments that operate systems with only kernels in the long term. But, no one fits all. It is not very easy to control in environments having more controlled characteristics and user-space control towers. We actually got multiple reports [1,2] of use cases that the algorithm is not optimal. 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 introduces no 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 | 10 ++++++++++ mm/damon/core.c | 1 + 2 files changed, 11 insertions(+) diff --git a/include/linux/damon.h b/include/linux/damon.h index 6bd71546f7b20..0824b953492e8 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -215,12 +215,21 @@ 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. * @ms: Maximum milliseconds that the scheme can use. * @sz: Maximum bytes of memory that the action can be applied. * @goals: Head of quota tuning goals (&damos_quota_goal) list. + * @goal_tuner: Goal-based @esz tuning algorithm to use. * @esz: Effective size quota in bytes. * * @weight_sz: Weight of the region's size for prioritization. @@ -262,6 +271,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 7f74982535aca..c16a390152790 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -912,6 +912,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 Thu Apr 9 09:01:31 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 7A7793093DF; Tue, 10 Mar 2026 01:05:39 +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=1773104739; cv=none; b=MDgYiY95nbjBYAH4YBKXHLykJomhzizyxZlS03A7UhPuU/QXC4UJYBhRlxHy7FoiqhAJnc+I+xMAALsPg1Kl9jmF0q0uK8Z9KkgADyluARlC1KUWTQQbwAT0sJ7Pcj9kyOF7S0D+M+gxnpxz9DAPGW8eG/eCERb5OcXJNQpPfhg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773104739; c=relaxed/simple; bh=L8f/ifxCU2NPf0V1A0Et6pf5vfY3OtYSlSoZEdh8jTI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZCg8wZpHgHegaxs1kuVzxvvRy19yyUbwaKTh2gYsk3lv4x7ZBEvs1quwtaSV8QBMKE/MN7D666dcps+g86+3fQISSwHkaw6NBvQPcBwP5KSI/OaDgr+1PHZcsIEABoz5DU7BYekW+q9ErmItX8qj5NWPUWXp0AViyIOkI6mDkqw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JwHQBb75; 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="JwHQBb75" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C506C2BCAF; Tue, 10 Mar 2026 01:05:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773104739; bh=L8f/ifxCU2NPf0V1A0Et6pf5vfY3OtYSlSoZEdh8jTI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JwHQBb75BCYx3628Zxc7T+Zu7KR5tq2xk1nZTwDdDxBbqgbplC7OkjNBj7MMlW7ZM LB1wwsCjxl/y9HM4kkxf6lHsvgWZBKZbKk7q0H7y0a8R7qDqGhR7Rgmgongi6RxHAW hbFIeMezZBsnj/i/tponGizAAugNueUtKN/8Oeg7YpJji5Fd2wDDclB/Jq/Q7g/Nb0 xMPcV2kruZHaqsrTijWC6Oob73912ZbNlLS9HOn5mzhrlq8lAsSD8AwXUPFrnDrZrP ad0wz24W24FIfBZ/U52FUnSigozYkRza7zPOXaDrOQ8T5/4YE11Q3BRfBDetveZKKb SOpTYoAY+OZjQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 02/11] mm/damon/core: allow quota goals set zero effective size quota Date: Mon, 9 Mar 2026 18:05:18 -0700 Message-ID: <20260310010529.91162-3-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260310010529.91162-1-sj@kernel.org> References: <20260310010529.91162-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" User-explicit quotas (size and time quotas) having zero value means the quotas are unset. And, effective size quota is set as the minimum value of the explicit quotas. When quota goals are set, the goal-based quota tuner can make it lower. But the existing only single tuner never sets the effective size quota zero. Because of the fact, DAMON core assumes zero effective quota means the user has set no quota. Multiple tuners are now allowed, though. In the future, some tuners might want to set a zero effective size quota. There is no reason to restrict that. Meanwhile, because of the current implementation, it will only deactivate all quotas and make the scheme work at its full speed. Introduce a dedicated function for checking if no quota is set. The function checks the fact by showing if the user-set explicit quotas are zero and no goal is installed. It is decoupled from zero effective quota, and hence allows future tuners set zero effective quota for intentionally deactivating the scheme by a purpose. Signed-off-by: SeongJae Park --- mm/damon/core.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index c16a390152790..d351ef3bcf4e9 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -387,6 +387,11 @@ void damos_destroy_quota_goal(struct damos_quota_goal = *g) damos_free_quota_goal(g); } =20 +static bool damos_quota_goals_empty(struct damos_quota *q) +{ + return list_empty(&q->goals); +} + /* initialize fields of @quota that normally API users wouldn't set */ static struct damos_quota *damos_quota_init(struct damos_quota *quota) { @@ -1789,12 +1794,24 @@ static bool __damos_valid_target(struct damon_regio= n *r, struct damos *s) r->age <=3D s->pattern.max_age_region; } =20 +/* + * damos_quota_is_set() - Return if the given quota is actually set. + * @quota: The quota to check. + * + * Returns true if the quota is set, false otherwise. + */ +static bool damos_quota_is_set(struct damos_quota *quota) +{ + return quota->esz || quota->sz || quota->ms || + !damos_quota_goals_empty(quota); +} + static bool damos_valid_target(struct damon_ctx *c, struct damon_region *r, struct damos *s) { bool ret =3D __damos_valid_target(r, s); =20 - if (!ret || !s->quota.esz || !c->ops.get_scheme_score) + if (!ret || !damos_quota_is_set(&s->quota) || !c->ops.get_scheme_score) return ret; =20 return c->ops.get_scheme_score(c, r, s) >=3D s->quota.min_score; @@ -2064,7 +2081,8 @@ static void damos_apply_scheme(struct damon_ctx *c, s= truct damon_target *t, } =20 if (c->ops.apply_scheme) { - if (quota->esz && quota->charged_sz + sz > quota->esz) { + if (damos_quota_is_set(quota) && + quota->charged_sz + sz > quota->esz) { sz =3D ALIGN_DOWN(quota->esz - quota->charged_sz, c->min_region_sz); if (!sz) @@ -2083,7 +2101,8 @@ static void damos_apply_scheme(struct damon_ctx *c, s= truct damon_target *t, quota->total_charged_ns +=3D timespec64_to_ns(&end) - timespec64_to_ns(&begin); quota->charged_sz +=3D sz; - if (quota->esz && quota->charged_sz >=3D quota->esz) { + if (damos_quota_is_set(quota) && + quota->charged_sz >=3D quota->esz) { quota->charge_target_from =3D t; quota->charge_addr_from =3D r->ar.end + 1; } @@ -2111,7 +2130,8 @@ static void damon_do_apply_schemes(struct damon_ctx *= c, continue; =20 /* Check the quota */ - if (quota->esz && quota->charged_sz >=3D quota->esz) + if (damos_quota_is_set(quota) && + quota->charged_sz >=3D quota->esz) continue; =20 if (damos_skip_charged_region(t, r, s, c->min_region_sz)) @@ -2396,7 +2416,8 @@ static void damos_adjust_quota(struct damon_ctx *c, s= truct damos *s) /* New charge window starts */ if (time_after_eq(jiffies, quota->charged_from + msecs_to_jiffies(quota->reset_interval))) { - if (quota->esz && quota->charged_sz >=3D quota->esz) + if (damos_quota_is_set(quota) && + quota->charged_sz >=3D quota->esz) s->stat.qt_exceeds++; quota->total_charged_sz +=3D quota->charged_sz; quota->charged_from =3D jiffies; --=20 2.47.3 From nobody Thu Apr 9 09:01:31 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 BC77C309F08; Tue, 10 Mar 2026 01:05:39 +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=1773104739; cv=none; b=XeC96ZPk5gCeQciNkkLKBt27KFPkVHoI86V8sd1r/IKQrnI6zoODu4SIAVysvAjKrDdxetQBcrl8JEuKtlh9uVN6QqZisJirF8fuuEM1Dcq6qSMkGxJTMbWHhZAsqhfKH+9NCcIaCwP+42bwoqWdvuq0Qtl4e0/o6xqhVQA7Zpc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773104739; c=relaxed/simple; bh=/BXc7B9uaztn0WoEaxSSPUefWVgQvngZEj+kk1cUbBs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VAsH2QhLIPybsAxJGzgW64EW5fr3yIxmOMYg/osd50VpwU/Z512UpVxHx0w/jFc32Ph7yNt60MG9TvPNTtH2RhDC+25rAEhFAMNpEHoK1Fis3NxFMumEOA0fnLQ3+sHIMKwTRoCcDmshYUDYUaGdAo/4H5rrvxxbhnCCorLkWdU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QbK4s+oK; 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="QbK4s+oK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 417DCC2BCB0; Tue, 10 Mar 2026 01:05:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773104739; bh=/BXc7B9uaztn0WoEaxSSPUefWVgQvngZEj+kk1cUbBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QbK4s+oKLNIyPuQAWDZFRszKHp83zgpPaGRUIYSdF6Yjxaq+GyJS1uLyyU2pYTpvJ wz0x6oiqUiAzYFtlNzwuIXQIM+3mb6DKuNw2T5d0PqPvPjTZqjBfaH86sft56Bh/29 QnWdSq8DEFAYop8n2nf+Zw8GzJCfZQ9UCuc/J6d5fn+XiCN4QAMW4d5E6vK4OkaHj+ jSwnr4r+ZUisnFx/JoaTdG9f9etLyb2prTa71xkhNzEGeg1guZf9wKW8X2pCg8Q7Fa Sbm3vVcby6kJPuEwi+FDOXXdgR+mY3J8VsBCczLs4Dd9VnlMImFOAiMf4TgS8nL7i+ nqstMJjSWvhjg== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 03/11] mm/damon/core: introduce DAMOS_QUOTA_GOAL_TUNER_TEMPORAL Date: Mon, 9 Mar 2026 18:05:19 -0700 Message-ID: <20260310010529.91162-4-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260310010529.91162-1-sj@kernel.org> References: <20260310010529.91162-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, to achieve the goal as soon as possible. For the temporal period, it uses as much quota as allowed. Once the goal is achieved, it sets the quota zero, so effectively makes 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 0824b953492e8..1130c2f9a92f4 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -218,9 +218,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 d351ef3bcf4e9..2e36024d99506 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -2345,6 +2345,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 */ @@ -2359,11 +2379,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 Thu Apr 9 09:01:31 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 DC8D530AD00; Tue, 10 Mar 2026 01:05:39 +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=1773104740; cv=none; b=WuPhNRbMM/xAFiQMNllPhORwMe2aDJnJ21HysbBELoJv4pqabbKSUDXrNaIyzE/Zs8jb0k8w0djBZpLrB6Wv2OHWbbvP/21sv8AfO3hWbZWdJk56DY7CL1j1p1OaU+SO1yBjONdiT1NzXO2p2NpTGHUsLiU882I9Fm40r/+/hpY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773104740; c=relaxed/simple; bh=Cz0dujDOIX0D2wsuyXTUh/TXx2EbdEyN7109tlsNnZY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eSUf9BKbpExJ0PribonukySXfsgdqvJ0AJUFa7w0Zp1wFfwNIuYHzLYV+2OIrt4dWEwY/+kf9snXC7vq3cvjOayeY6OL8GfgAzmGSV5Nlz/Epq79AEoclvz09cqPem5XWEKxctSlKtjWMW5hy4zLSGiqnG97sqSqxiHg8Tt0NqY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S5bB3l/0; 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="S5bB3l/0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77363C2BC9E; Tue, 10 Mar 2026 01:05:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773104739; bh=Cz0dujDOIX0D2wsuyXTUh/TXx2EbdEyN7109tlsNnZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S5bB3l/0m9unxgS+qkS3UArseKP+wJiPVsVgupZfgOXPIWS3SRaTfVl9OfC9cNRd9 xrbuMZ43D8y28CXYotQMm7UEFYOeKknNxMDlcRfmRD2a1+U0tV3YCoIatMxuPvWSfZ +Iyl1X696Tp2nHJKrekAyoVU22CWvKLjBt4ymYZqhGtMBOUkPMTLOGywU1dqimhLMZ vJb5ZvaoAUlBdYk/r5UEgE8s6njfCjk42hAYFOZ7Hcoj/JQL1HB8X4P3VvxHbt1g11 lnHcC5vg4w4PABYPOsDO3U5fUn/Djl4KlJcOdPzQsmIvVfI3I8n/D9koGvnFG4jYnU FFYvUkTMcI3GQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 04/11] mm/damon/sysfs-schemes: implement quotas->goal_tuner file Date: Mon, 9 Mar 2026 18:05:20 -0700 Message-ID: <20260310010529.91162-5-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260310010529.91162-1-sj@kernel.org> References: <20260310010529.91162-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 the name of the tuner to the file. Reading the file returns the name of the currently selected tuner. 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 3a0782e576fab..5186966dafb35 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -1488,6 +1488,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) @@ -1610,6 +1611,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)); @@ -1627,11 +1680,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); @@ -2718,6 +2775,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 Thu Apr 9 09:01:31 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 6AC7630BB9D; Tue, 10 Mar 2026 01:05:40 +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=1773104740; cv=none; b=jxtM2xTXqFqpaOVjmsWdTWQ0NZkoqxVOMiQ8yB2mnoygwILngQMv0/j80RW/uSeeJXGNRq16fxhKcnNb55SB2mYz51bFQNysZ6MXFCDXW5jf9iiAti0F5vLrTXQz9fFJ1EyrDHR2b6/ILXpXK9PGfAqZ9+Uu/gyYt4Py2KgvBeI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773104740; c=relaxed/simple; bh=yTvCo+JXdygWDppuMY59cBuy+ffz+XijY5gZYAbrrfU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EaTfY7jy5pe9yW5KvypM65mYymvbf9hJJVe5vIeBLYWZmC0hc1VOfovlc3iqVvzMT8e/IgMhLZUVF1Up2L+W4B8SO9jmWbKff/1gDAIRaF/MlPykGviT3nPf5VlXT++rYpOpkxaWk5lVnU40sDiEq8wQ9U/csrdG13eiKGwwbxw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IfiM1MsN; 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="IfiM1MsN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B00F9C2BCAF; Tue, 10 Mar 2026 01:05:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773104740; bh=yTvCo+JXdygWDppuMY59cBuy+ffz+XijY5gZYAbrrfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IfiM1MsNSmm3WEADxWNf29ZgMu+jsFkfxsa2a2ZOxtfqhMDKNeD4ymTphfOlK8ULi Gpmws3E34ovE+lMw5Jgqouj5gpLzn6WB3zijl+7gt0TWPOFXyY67xN0S07TzsULSrU cPb1hp7ctCr8nL5HcRsvnTojy3TyNihgWh/Lqvod+yWvM/9Z2XwkqBcPHoOG9Vqm5d dIdKAu5t9IBBqdnBVxMlE6Y4DQ/kVWYimUhqdXZT47ksdqKjTTp3FtttOtWBA7ds2j 4ycyG6DGB76YlDz+ureGMT/9Yfd71uJ40L3SmuZRl8JP48I3UjH0GIOeGotkXbA5Ce YZ508Oi6fPOTA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , "Liam R. Howlett" , David Hildenbrand , Jonathan Corbet , Lorenzo Stoakes , Michal Hocko , Mike Rapoport , Shuah Khan , Suren Baghdasaryan , Vlastimil Babka , damon@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 05/11] Docs/mm/damon/design: document the goal-based quota tuner selections Date: Mon, 9 Mar 2026 18:05:21 -0700 Message-ID: <20260310010529.91162-6-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260310010529.91162-1-sj@kernel.org> References: <20260310010529.91162-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" Update the design document for the newly added goal-based quota tuner selection feature. 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 ac795f30519c5..29fff20b3c2a9 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -566,6 +566,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 Thu Apr 9 09:01:31 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 A6D5A2E9730; Tue, 10 Mar 2026 01:05:40 +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=1773104740; cv=none; b=rqFP4bRs5SBTo8foGATfrHTaiEYOWM1G3bTgO4JTe4EZagfLtgiRzjshsimpBnC2zQ8Mwhw6brTsPjQgpUHhHbkmQ4wmI+JNTdRMs6RPC1PfG2YfzFOrXmy7lSdEW4iktwWiJGJO/jUcXwIRVU/vif08+TzErai6bvYzsNPbw9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773104740; c=relaxed/simple; bh=8g5RM84PzzTOH9XhkrAPhPyfvWGkJhpn6rsV5ukGTjU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KiZu7cSZJi3QJuQz+X/8konwTMf3zpPeqpgBub8PSv95m2f1omxP5VXS7IUStz17AbUh2aG1x/2iX5hmh9OgUQmr3p3weGGISbiyhWaHCH7PbgT7zYt0hs6P4qqsXW6UPJUGvnTVIf7kYJ21BNdOFm2rr6j7k8qcPU5K9p6oO1Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gBwjHDJb; 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="gBwjHDJb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21F16C2BCB0; Tue, 10 Mar 2026 01:05:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773104740; bh=8g5RM84PzzTOH9XhkrAPhPyfvWGkJhpn6rsV5ukGTjU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gBwjHDJb5FNMs4+6fg//+BneuH8gokx0udvi/q2s3S9GwqombT+uPVubEw41mquHE UuxckTAdvSweLAQLwEUFz5Ryfw6r0J3YtrYe6dR3C9GSzp1EbGMaTIBNtKUS90y/wa /X4w8R210/TNxc1imAGaUtgPWt4VkMELhjnNx+spUf/N0CWxP5mez3pGE7o63VHpsx TQRXaUY2jRdnYMoNYStNFqNCI2bRb5vQteR3qBhrUoHXnQdoh/CK8yY7lnAaJy2PAn p1G9XxX2JdLXPjRQoFBxyurqvS9jXtpTn+gXn4EhdDl5cLfyWweNFv1TOEY7c7iHM/ 3/l4Cc3Avg+NA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , "Liam R. Howlett" , David Hildenbrand , Jonathan Corbet , Lorenzo Stoakes , Michal Hocko , Mike Rapoport , Shuah Khan , Suren Baghdasaryan , Vlastimil Babka , damon@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 06/11] Docs/admin-guide/mm/damon/usage: document goal_tuner sysfs file Date: Mon, 9 Mar 2026 18:05:22 -0700 Message-ID: <20260310010529.91162-7-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260310010529.91162-1-sj@kernel.org> References: <20260310010529.91162-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 algorithm selection. 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 From nobody Thu Apr 9 09:01:31 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 B59F830BF6C; Tue, 10 Mar 2026 01:05:40 +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=1773104740; cv=none; b=jVty9BxqwRS5ka9vHeSyYpIrELgKmETEiiNG4FlJ72zh3+qdMdveOROEWQjccMVJAn8zs/C1k+conf0QmU2etU6LINbyzK4JZVy42hHFvvVy3+f5tO5MzlDj72G7HP2/wMpiD0PetFwV3U+2LQ1wuEsqKhh0nyDwt5CRk6mMs3g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773104740; c=relaxed/simple; bh=X4gj60NUP5Gx9WKLfYMZxZSkKyfsCySS7inf5fgIm6M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bMt0NF6a6k6CtJh69bO+miGg+AneMUU8l1LCb2rc56EMv7EvV8h4nj6XA5B9PCTAvRqiEq0FU+SPYIgtDEPwB2NsPTVsLnxUi9Cy/rTKzA1SXN1ltYwL3d4sMqURWX47rz1vByrOGQ+KkmAYklm4RziM9YBbDpyKKC5aDvY4/hs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H3rTn648; 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="H3rTn648" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82F6CC2BCB1; Tue, 10 Mar 2026 01:05:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773104740; bh=X4gj60NUP5Gx9WKLfYMZxZSkKyfsCySS7inf5fgIm6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H3rTn648M6dajZCpxKbTycwPJf6G272kVzHHeHbK/Y/CBXrojLvFwyEzlurwCstOg aXpBz5UMcg0Uaw7XOW8Sbl4LHV8DM11G2a3bSoXvU5UBC7bjihk5Ms9kf+ONsrz8L8 7HbBRkP7Z84yYcD0yP53BTh0q3R+BfnDwJIhd50V9V10+0sL4HNsjChdKHTIU8sYE0 gzUzZboj9P/712G/ilDUCc/8KLis1Q/x1VYUko72qfVX8mKTMjOz4W2BGWwNUW0q8j 55CXtl5njcr5pn2P3jRrqB470qWXExSHWqwgBiOfzmUWDa0IYHgvYJcYZZ7K9wFK2y +sLnW0JkmiV3A== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 07/11] Docs/ABI/damon: update for goal_tuner Date: Mon, 9 Mar 2026 18:05:23 -0700 Message-ID: <20260310010529.91162-8-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260310010529.91162-1-sj@kernel.org> References: <20260310010529.91162-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" Update the ABI document for the newly added goal_tuner sysfs file. Signed-off-by: SeongJae Park --- Documentation/ABI/testing/sysfs-kernel-mm-damon | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-damon b/Documentatio= n/ABI/testing/sysfs-kernel-mm-damon index f2af2ddedd323..2424237ebb105 100644 --- a/Documentation/ABI/testing/sysfs-kernel-mm-damon +++ b/Documentation/ABI/testing/sysfs-kernel-mm-damon @@ -316,6 +316,12 @@ Contact: SeongJae Park Description: Writing to and reading from this file sets and gets the path parameter of the goal. =20 +What: /sys/kernel/mm/damon/admin/kdamonds//contexts//schemes//qu= otas/goal_tuner +Date: Mar 2026 +Contact: SeongJae Park +Description: Writing to and reading from this file sets and gets the + goal-based effective quota auto-tuning algorithm to use. + What: /sys/kernel/mm/damon/admin/kdamonds//contexts//schemes//qu= otas/weights/sz_permil Date: Mar 2022 Contact: SeongJae Park --=20 2.47.3 From nobody Thu Apr 9 09:01:31 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 6FA8030C621; Tue, 10 Mar 2026 01:05:41 +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=1773104741; cv=none; b=pJXr12uZA2cE5zrsUZTjhEHc5Sy05fF+tbVcBSwfh2fKijdWkr6hcPgSEPp4d5LcIJd0yYu0lWUbc+ijFhzDw5iy3YLKO0S3YJqMaU7fCgMEPwgclAqOcD29txY2amc/tp0k0nvZi+mRaaKHscyFMlyRlmbGYB3nautrlhhRhKc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773104741; c=relaxed/simple; bh=RnZI/MXRpMMVI21PH3lD5eWdT2CRwxGrwP2sFfAnvFQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Fr2Y9RQ4S573FcO4bZoQnKP75E92ClECuRlKBImYfO17OLBeQlNf8bB8BNg2JCFZ0r61ViR/PQHa97+aFboBk14VpZ9cWGYvuQvYwV3cqSQ+Depbu8E77hgBLP1+i3i3b9c5UVygBZWI7Kw7j1eCHKgBGI6TGN33q9DXN9HUvJI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UlaywHj+; 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="UlaywHj+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7DA2C2BCAF; Tue, 10 Mar 2026 01:05:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773104740; bh=RnZI/MXRpMMVI21PH3lD5eWdT2CRwxGrwP2sFfAnvFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UlaywHj+K9Zz2qhj7I/fWERoGNXH/0LTgb4PdowthXyd5FwlOhmslyFIZVF6MfnW4 lu6sAjCygck1yJ50owxWPe+2ogZEGybivoRQTi6jwkZUegDx2Om42qstvvTRxM1xnk w/p/ek4mLghJswoGvuTMoekqXnrVUougnaKYcrJOMUojXiqCK4TKOwYi3CB3GkhJcX OtfWIviJ5z0K5CTEaqw1J4sGw8ECJsbAQPg6W1wS3uKfb0+HpPI//zFwSgE3LhNbn4 KvkR2hPivPaKl7ELQZRIXpC19bxZUrkQ9eFqm/hfxdIQCeMORQkeelINdGfu6uE0Gv 0nfdGv4YoRJ5w== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Brendan Higgins , David Gow , damon@lists.linux.dev, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 08/11] mm/damon/tests/core-kunit: test goal_tuner commit Date: Mon, 9 Mar 2026 18:05:24 -0700 Message-ID: <20260310010529.91162-9-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260310010529.91162-1-sj@kernel.org> References: <20260310010529.91162-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" Extend damos_commit_quota() kunit test for the newly added goal_tuner parameter. Signed-off-by: SeongJae Park --- mm/damon/tests/core-kunit.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index e86d4f4fe261a..9e5904c2beeb2 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -693,6 +693,7 @@ static void damos_test_commit_quota(struct kunit *test) .reset_interval =3D 1, .ms =3D 2, .sz =3D 3, + .goal_tuner =3D DAMOS_QUOTA_GOAL_TUNER_CONSIST, .weight_sz =3D 4, .weight_nr_accesses =3D 5, .weight_age =3D 6, @@ -701,6 +702,7 @@ static void damos_test_commit_quota(struct kunit *test) .reset_interval =3D 7, .ms =3D 8, .sz =3D 9, + .goal_tuner =3D DAMOS_QUOTA_GOAL_TUNER_TEMPORAL, .weight_sz =3D 10, .weight_nr_accesses =3D 11, .weight_age =3D 12, @@ -714,6 +716,7 @@ static void damos_test_commit_quota(struct kunit *test) KUNIT_EXPECT_EQ(test, dst.reset_interval, src.reset_interval); KUNIT_EXPECT_EQ(test, dst.ms, src.ms); KUNIT_EXPECT_EQ(test, dst.sz, src.sz); + KUNIT_EXPECT_EQ(test, dst.goal_tuner, src.goal_tuner); KUNIT_EXPECT_EQ(test, dst.weight_sz, src.weight_sz); KUNIT_EXPECT_EQ(test, dst.weight_nr_accesses, src.weight_nr_accesses); KUNIT_EXPECT_EQ(test, dst.weight_age, src.weight_age); --=20 2.47.3 From nobody Thu Apr 9 09:01:31 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 851AE2FD68B; Tue, 10 Mar 2026 01:05:41 +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=1773104741; cv=none; b=GuUcuKXlfmBPh0jkaOzZNvFWpofmw1VdmVOoSYdbo/gMTSOSQ6VVDLmPajdhg9VNdwdYSa1OjZuErl3el9zVWsKY/chFeFng2TY9712buRXtWiHfTjN37hCgN1AczuvZxNFz/H+YTs0+Bh34Y3M3Po2za/ReAoXIWqIMOItA71c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773104741; c=relaxed/simple; bh=+HQX6Y6KyyaMrF3l90vkRlVOFR5aGGsrQWEn3/nSaHo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WPIyCywXt/Z0QQsCm9sgT2bU+hppF3VkGzaKIroMwSn9p1Ze25UPtsTGPv1xhY5dyg5JhwE8U9SzpNwqIXHs6hCVJTuzGRfAFJUlOinLOZ8nIwxCcXcdngkLuJpwhlGgZ1oHUZoNGazxsPxNE8MzX4A+KaVOIJJjDzhAbKpJf/k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hIfVawCJ; 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="hIfVawCJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A1CBC2BC9E; Tue, 10 Mar 2026 01:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773104741; bh=+HQX6Y6KyyaMrF3l90vkRlVOFR5aGGsrQWEn3/nSaHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hIfVawCJQa9bYg3f7JUHsBC/cPW2bdAnnuZpTLNWgt9P9RklDCFBYGMDfUdzC6G3V 5Q6H8vmJ5r/SXhNnueZA+Ey/nacn36kqUhS+83S5h3P0gCKdxYb5zNgPnb8G9s0Ro+ hkwLzCze0vumYA5pjIi2s/Jp1bCMlT5Fw2Upw6OuJZ8qVpIftBr96LBsgKqGqQr7GP IvdSJKLYsM8VsSYj1FS9tsTVXKxisFssiekxS3kf4eJTse9g77xFLA50oQn1oeDbfZ +eBa8bJMqIfcoJu5dsafmpwPdSiUn4mfAdE8X/gWSS5tX0s37m241rujWZyOr51eEE Fa/SNDczfXaVQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Shuah Khan , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 09/11] selftests/damon/_damon_sysfs: support goal_tuner setup Date: Mon, 9 Mar 2026 18:05:25 -0700 Message-ID: <20260310010529.91162-10-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260310010529.91162-1-sj@kernel.org> References: <20260310010529.91162-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 support of goal_tuner setup to the test-purpose DAMON sysfs interface control helper, _damon_sysfs.py. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/_damon_sysfs.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/= selftests/damon/_damon_sysfs.py index 748778b563cd2..2b4df655d9fd0 100644 --- a/tools/testing/selftests/damon/_damon_sysfs.py +++ b/tools/testing/selftests/damon/_damon_sysfs.py @@ -130,15 +130,16 @@ class DamosQuota: sz =3D None # size quota, in bytes ms =3D None # time quota goals =3D None # quota goals + goal_tuner =3D None # quota goal tuner reset_interval_ms =3D None # quota reset interval weight_sz_permil =3D None weight_nr_accesses_permil =3D None weight_age_permil =3D None scheme =3D None # owner scheme =20 - def __init__(self, sz=3D0, ms=3D0, goals=3DNone, reset_interval_ms=3D0, - weight_sz_permil=3D0, weight_nr_accesses_permil=3D0, - weight_age_permil=3D0): + def __init__(self, sz=3D0, ms=3D0, goals=3DNone, goal_tuner=3D'consist= ', + reset_interval_ms=3D0, weight_sz_permil=3D0, + weight_nr_accesses_permil=3D0, weight_age_permil=3D0): self.sz =3D sz self.ms =3D ms self.reset_interval_ms =3D reset_interval_ms @@ -146,6 +147,7 @@ class DamosQuota: self.weight_nr_accesses_permil =3D weight_nr_accesses_permil self.weight_age_permil =3D weight_age_permil self.goals =3D goals if goals is not None else [] + self.goal_tuner =3D goal_tuner for idx, goal in enumerate(self.goals): goal.idx =3D idx goal.quota =3D self @@ -191,6 +193,10 @@ class DamosQuota: err =3D goal.stage() if err is not None: return err + err =3D write_file( + os.path.join(self.sysfs_dir(), 'goal_tuner'), self.goal_tu= ner) + if err is not None: + return err return None =20 class DamosWatermarks: --=20 2.47.3 From nobody Thu Apr 9 09:01:31 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 B0A7930E0D6; Tue, 10 Mar 2026 01:05:41 +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=1773104741; cv=none; b=lmi2z/zusVRIa3DxCmiq3NeuFO++m/BP4rVng8LwyDlcFe3zBqStONCZRKZ00JUb2g5qj+wfxpDqW7NnZX92kerCSNYMRFT5MfIQAY81zwDk45gBlWEkNNLaa1zjSV7fS+Ya1FbKdc6RRXLungDLl9AxQUGxTrdZ9shzqgK718U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773104741; c=relaxed/simple; bh=pVuHdsiSK2hSc3Y/sliHzMztEBUolq4unjdQPlB02FQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c9zy0n9Ey6hz7WNjGcV1Eh0gT8ByQtxOfk0Ue0Nztypq00HsGa3lsK3V3PIz6kMzf0+VEjDAudUjH1Wz6jiSRuK8n3pU/yolTH0NQGLf8dWvv6Va1hVvy89b96nmMRPS/LN7qjy/4bSptZ2lVzfAW0y/jM67Y0F1viniPhU8fuU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WROYJi3p; 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="WROYJi3p" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A064C19423; Tue, 10 Mar 2026 01:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773104741; bh=pVuHdsiSK2hSc3Y/sliHzMztEBUolq4unjdQPlB02FQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WROYJi3pg0s9YWJLtb+YkNLSNrzNt3u+ZPN0u5lL3irj8Sy28JYveAk4Lu1PnS64o 8JI9DNZvmkX8CufiB8zkHDzzB+EmakY92070cqRJWTX4NdIJf3iEnSGR6O6OSONmOB TyuDCBrXCcOl8T4PolU8RlQV+0J1SUX5r1rAEo/i3Em+4dCHZxIcSSIpP/ZTlhxpp4 qQaci1MxArBksMyUq2EDe9KhB7UVYn8TVaUatqrYxvnGx8fcW4Cszai3cArqlcmTwO nvWDvL4/UbwL+MYsk00wG7bIf8RpXxJGjzz1unXbzx12hoLVQ/hT4K03FnZuFX9FBw BKwY05JUwjLug== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Shuah Khan , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 10/11] selftests/damon/drgn_dump_damon_status: support quota goal_tuner dumping Date: Mon, 9 Mar 2026 18:05:26 -0700 Message-ID: <20260310010529.91162-11-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260310010529.91162-1-sj@kernel.org> References: <20260310010529.91162-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" Update drgn_dump_damon_status.py, which is being used to dump the in-kernel DAMON status for tests, to dump goal_tuner setup status. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/drgn_dump_damon_status.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/damon/drgn_dump_damon_status.py b/tool= s/testing/selftests/damon/drgn_dump_damon_status.py index 5374d18d1fa8d..af99b07a4f565 100755 --- a/tools/testing/selftests/damon/drgn_dump_damon_status.py +++ b/tools/testing/selftests/damon/drgn_dump_damon_status.py @@ -110,6 +110,7 @@ def damos_quota_to_dict(quota): ['reset_interval', int], ['ms', int], ['sz', int], ['goals', damos_quota_goals_to_list], + ['goal_tuner', int], ['esz', int], ['weight_sz', int], ['weight_nr_accesses', int], --=20 2.47.3 From nobody Thu Apr 9 09:01:31 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 C9A0530E84F; Tue, 10 Mar 2026 01:05:41 +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=1773104741; cv=none; b=PNyVMn60Eo+Jwv4oLF69g5cWSYMB3ZQLAkQW4pUZnOvxhbdm6RiZGEGXeIdAwv792sLVeNbIcyUu4ICCb+7zTt24r9ysNi0FQxPHuYxCd+Oo8jGvIo0y1HeQq3wS1bG8TKkINsVNYVM/aEH0RSAPvJGAZEJjteqBbskI36wErpQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773104741; c=relaxed/simple; bh=AVTjUet9MVkl4nT/vo+5gBPPg8P0HSyE/9BxBCU3HWc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YutMvdc5Beex4VUi6SaV2B5cDJEC0OPAt1FS1GKJVd1OyBNF9NT1Zvw31dzMaGDCYsdcULIW34e1fLlVouhmTQcVsEKmB17O4tat/vHLXLbvS5IzQSedGkSxGOoyCYLlQXbR/OKWzD++phuLHIUmEd5fmgls5Uk+nWWp9wisrEM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UIvhq/+h; 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="UIvhq/+h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A5CBC4CEF7; Tue, 10 Mar 2026 01:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773104741; bh=AVTjUet9MVkl4nT/vo+5gBPPg8P0HSyE/9BxBCU3HWc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UIvhq/+hQeYCPKpUSP8TXJy821rg4ytdFyEXUI+ixQkl0TJQTits7tVebKPesxw/G Z5HLBb+unJAdHwBLWUZ9NwpWhy9/nbURcBYGy4TFR+nTWjz0Op1C4yNLZqB5xrHNAa 9GICtl/JDQ8jxO83MGZlTlmcP2I/qfoadPJ1D6tQBnZlPwFa313go/OyB/OZR8Hwvp XnRGjlKY9wLyxksizKapi9IEDDkcQXL0KvvgurJursHtUbUWla7/5ieBF7RFh8aJBo YkX+ppKXbjeghAvFx20l1dQSBYCfG6GcBb6AHtYhALLXmiUxGRTQA+lf6oq3UGN5YR c5La8jwN0cClQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Shuah Khan , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 11/11] selftests/damon/sysfs.py: test goal_tuner commit Date: Mon, 9 Mar 2026 18:05:27 -0700 Message-ID: <20260310010529.91162-12-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260310010529.91162-1-sj@kernel.org> References: <20260310010529.91162-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" Extend the near-full DAMON parameters commit selftest to commit goal_tuner and confirm the internal status is updated as expected. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/sysfs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/damon/sysfs.py b/tools/testing/selftes= ts/damon/sysfs.py index 9cca71eb0325e..3aa5c91548a53 100755 --- a/tools/testing/selftests/damon/sysfs.py +++ b/tools/testing/selftests/damon/sysfs.py @@ -67,6 +67,12 @@ def assert_quota_committed(quota, dump): assert_true(dump['sz'] =3D=3D quota.sz, 'sz', dump) for idx, qgoal in enumerate(quota.goals): assert_quota_goal_committed(qgoal, dump['goals'][idx]) + tuner_val =3D { + 'consist': 0, + 'temporal': 1, + } + assert_true(dump['goal_tuner'] =3D=3D tuner_val[quota.goal_tuner], + 'goal_tuner', dump) assert_true(dump['weight_sz'] =3D=3D quota.weight_sz_permil, 'weight_s= z', dump) assert_true(dump['weight_nr_accesses'] =3D=3D quota.weight_nr_accesses= _permil, 'weight_nr_accesses', dump) @@ -231,6 +237,7 @@ def main(): metric=3D'node_mem_used_bp', target_value=3D9950, nid=3D1)], + goal_tuner=3D'temporal', reset_interval_ms=3D1500, weight_sz_permil=3D20, weight_nr_accesses_permil=3D200, --=20 2.47.3