linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms
@ 2026-03-04  4:41 SeongJae Park
  2026-03-04  4:41 ` [RFC PATCH v2 01/10] mm/damon/core: introduce damos_quota_goal_tuner SeongJae Park
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: SeongJae Park @ 2026-03-04  4:41 UTC (permalink / raw)
  Cc: SeongJae Park, Liam R. Howlett, Andrew Morton, David Hildenbrand,
	Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
	Shuah Khan, Shuah Khan, Suren Baghdasaryan, Vlastimil Babka,
	damon, linux-doc, linux-kernel, linux-kselftest, linux-mm

Aim-oriented DAMOS quota auto-tuning uses a single tuning algorithm.
The algorithm is designed to find a quota value that should be
consistently kept for achieving the aimed goal for long term.  It is
useful and reliable at automatically operating systems that have dynamic
environments in the long term.

As always, however, no single algorithm fits all.  When the environment
has static characteristics or there are control towers in not only the
kernel space but also the user space, the algorithm shows some
limitations.  In such environments, users want kernel work in a more
short term deterministic way.  Actually there were at least two reports
[1,2] of such cases.

Extend DAMOS quotas goal to support multiple quota tuning algorithms
that users can select.  Keep the current algorithm as the default one,
to not break the old users.  Also give it a name, "consist", as it is
designed to "consistently" apply the DAMOS action.  And introduce a new
tuning algorithm, namely "temporal".  It is designed to apply the DAMOS
action only temporally, in a deterministic way.  In more detail, as long
as the goal is under-achieved, it uses the maximum quota available.
Once the goal is over-achieved, it sets the quota zero.

Tests
=====

I confirmed the feature is working as expected using the latest version
of DAMON user-space tool, like below.

    $ # start DAMOS for reclaiming memory aiming 30% free memory
    $ sudo ./damo/damo start --damos_action pageout \
            --damos_quota_goal_tuner temporal \
            --damos_quota_goal node_mem_free_bp 30% 0 \
            --damos_quota_interval 1s \
            --damos_quota_space 100M

Note that >=3.1.8 version of DAMON user-space tool supports this feature
(--damos_quota_goal_tuner).  As expected, DAMOS stops reclaiming memory
as soon as the goal amount of free memory is made.  When 'consist' tuner
is used, the reclamation was continued even after the goal amount of
free memory is made, resulting in more than goal amount of free memory,
as expected.

Patch Sequence
==============

First four patches implement the features.  Patch 1 extends core API to
allow multiple tuners and make the current tuner as the default and only
available tuner, namely 'consist'.  Patch 2 allows future tuners setting
zero effective quota.  Patch 3 introduces the second tuner, namely
'temporal'.  Patch 4 further extends DAMON sysfs API to let users use
that.

Three following patches (patches 5-7) update design, usage, and ABI
documents, respectively.

Final three patches (patches 8-10) are for adding selftests.  The eighth
and the ninth patches extend the testing-purpose DAMON sysfs control
helper and DAMON status dumping tool to support the newly added feature.
The tenth patch extends the existing online commit test to cover the new
feature.

References
==========

[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

Changelog
=========

Changes from RFC v1
(https://lore.kernel.org/20260212062314.69961-1-sj@kernel.org)
- Add selftest for goal_tuner commitment.
- Set goal tuner inside damon_new_scheme().
- Allow zero size effective size quota.
- Update the ABI document.
- Wordsmith change descriptions.

SeongJae Park (10):
  mm/damon/core: introduce damos_quota_goal_tuner
  mm/damon/core: allow quota goals set zero effective size quota
  mm/damon/core: introduce DAMOS_QUOTA_GOAL_TUNER_TEMPORAL
  mm/damon/sysfs-schemes: implement quotas->goal_tuner file
  Docs/mm/damon/design: document the goal-based quota tuner selections
  Docs/admin-guide/mm/damon/usage: document goal_tuner sysfs file
  Docs/ABI/damon: update for goal_tuner
  selftests/damon/_damon_sysfs: support goal_tuner setup
  selftests/damon/drgn_dump_damon_status: support quota goal_tuner
    dumping
  selftests/damon/sysfs.py: test goal_tuner commit

 .../ABI/testing/sysfs-kernel-mm-damon         |  6 ++
 Documentation/admin-guide/mm/damon/usage.rst  | 16 +++--
 Documentation/mm/damon/design.rst             | 12 ++++
 include/linux/damon.h                         | 11 ++++
 mm/damon/core.c                               | 60 +++++++++++++++----
 mm/damon/sysfs-schemes.c                      | 58 ++++++++++++++++++
 tools/testing/selftests/damon/_damon_sysfs.py | 12 +++-
 .../selftests/damon/drgn_dump_damon_status.py |  1 +
 tools/testing/selftests/damon/sysfs.py        |  7 +++
 9 files changed, 166 insertions(+), 17 deletions(-)


base-commit: bbba4ca6322dd5c4f66fe31b1b374f77a8d2b2e5
-- 
2.47.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [RFC PATCH v2 01/10] mm/damon/core: introduce damos_quota_goal_tuner
  2026-03-04  4:41 [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms SeongJae Park
@ 2026-03-04  4:41 ` SeongJae Park
  2026-03-04  4:41 ` [RFC PATCH v2 02/10] mm/damon/core: allow quota goals set zero effective size quota SeongJae Park
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: SeongJae Park @ 2026-03-04  4:41 UTC (permalink / raw)
  Cc: SeongJae Park, Andrew Morton, damon, linux-kernel, linux-mm

Currently 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=ZsM1yX+MXx0ozVdsXnFqF4p0g+kATEitrWyZFfg@mail.gmail.com
[2] https://lore.kernel.org/20260204022537.814-1-yunjeong.mun@sk.com

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 include/linux/damon.h | 9 +++++++++
 mm/damon/core.c       | 2 ++
 2 files changed, 11 insertions(+)

diff --git a/include/linux/damon.h b/include/linux/damon.h
index 9a88cf8d152d8..63f1e3fdd3866 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 e8c44541754f7..c5503fdb10bb7 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -432,6 +432,7 @@ struct damos *damon_new_scheme(struct damos_access_pattern *pattern,
 	scheme->quota = *(damos_quota_init(quota));
 	/* quota.goals should be separately set by caller */
 	INIT_LIST_HEAD(&scheme->quota.goals);
+	scheme->quota.goal_tuner = quota->goal_tuner;
 
 	scheme->wmarks = *wmarks;
 	scheme->wmarks.activated = true;
@@ -904,6 +905,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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [RFC PATCH v2 02/10] mm/damon/core: allow quota goals set zero effective size quota
  2026-03-04  4:41 [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms SeongJae Park
  2026-03-04  4:41 ` [RFC PATCH v2 01/10] mm/damon/core: introduce damos_quota_goal_tuner SeongJae Park
@ 2026-03-04  4:41 ` SeongJae Park
  2026-03-04 10:18   ` Gutierrez Asier
  2026-03-04  4:41 ` [RFC PATCH v2 03/10] mm/damon/core: introduce DAMOS_QUOTA_GOAL_TUNER_TEMPORAL SeongJae Park
                   ` (8 subsequent siblings)
  10 siblings, 1 reply; 13+ messages in thread
From: SeongJae Park @ 2026-03-04  4:41 UTC (permalink / raw)
  Cc: SeongJae Park, Andrew Morton, damon, linux-kernel, linux-mm

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 <sj@kernel.org>
---
 mm/damon/core.c | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/mm/damon/core.c b/mm/damon/core.c
index c5503fdb10bb7..d657b87dd99e8 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);
 }
 
+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)
 {
@@ -1782,12 +1787,24 @@ static bool __damos_valid_target(struct damon_region *r, struct damos *s)
 		r->age <= s->pattern.max_age_region;
 }
 
+/*
+ * damos_quota_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_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 = __damos_valid_target(r, s);
 
-	if (!ret || !s->quota.esz || !c->ops.get_scheme_score)
+	if (!ret || !damos_quota_set(&s->quota) || !c->ops.get_scheme_score)
 		return ret;
 
 	return c->ops.get_scheme_score(c, r, s) >= s->quota.min_score;
@@ -2057,7 +2074,8 @@ static void damos_apply_scheme(struct damon_ctx *c, struct damon_target *t,
 	}
 
 	if (c->ops.apply_scheme) {
-		if (quota->esz && quota->charged_sz + sz > quota->esz) {
+		if (damos_quota_set(quota) &&
+				quota->charged_sz + sz > quota->esz) {
 			sz = ALIGN_DOWN(quota->esz - quota->charged_sz,
 					c->min_region_sz);
 			if (!sz)
@@ -2076,7 +2094,8 @@ static void damos_apply_scheme(struct damon_ctx *c, struct damon_target *t,
 		quota->total_charged_ns += timespec64_to_ns(&end) -
 			timespec64_to_ns(&begin);
 		quota->charged_sz += sz;
-		if (quota->esz && quota->charged_sz >= quota->esz) {
+		if (damos_quota_set(quota) &&
+				quota->charged_sz >= quota->esz) {
 			quota->charge_target_from = t;
 			quota->charge_addr_from = r->ar.end + 1;
 		}
@@ -2104,7 +2123,7 @@ static void damon_do_apply_schemes(struct damon_ctx *c,
 			continue;
 
 		/* Check the quota */
-		if (quota->esz && quota->charged_sz >= quota->esz)
+		if (damos_quota_set(quota) && quota->charged_sz >= quota->esz)
 			continue;
 
 		if (damos_skip_charged_region(t, r, s, c->min_region_sz))
@@ -2389,7 +2408,7 @@ static void damos_adjust_quota(struct damon_ctx *c, struct 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 >= quota->esz)
+		if (damos_quota_set(quota) && quota->charged_sz >= quota->esz)
 			s->stat.qt_exceeds++;
 		quota->total_charged_sz += quota->charged_sz;
 		quota->charged_from = jiffies;
-- 
2.47.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [RFC PATCH v2 03/10] mm/damon/core: introduce DAMOS_QUOTA_GOAL_TUNER_TEMPORAL
  2026-03-04  4:41 [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms SeongJae Park
  2026-03-04  4:41 ` [RFC PATCH v2 01/10] mm/damon/core: introduce damos_quota_goal_tuner SeongJae Park
  2026-03-04  4:41 ` [RFC PATCH v2 02/10] mm/damon/core: allow quota goals set zero effective size quota SeongJae Park
@ 2026-03-04  4:41 ` SeongJae Park
  2026-03-04  4:41 ` [RFC PATCH v2 04/10] mm/damon/sysfs-schemes: implement quotas->goal_tuner file SeongJae Park
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: SeongJae Park @ 2026-03-04  4:41 UTC (permalink / raw)
  Cc: SeongJae Park, Andrew Morton, damon, linux-kernel, linux-mm

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 <sj@kernel.org>
---
 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 63f1e3fdd3866..c4095b34f7929 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,
 };
 
 /**
diff --git a/mm/damon/core.c b/mm/damon/core.c
index d657b87dd99e8..51401d35f1b6b 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -2337,6 +2337,26 @@ static unsigned long damos_quota_score(struct damos_quota *quota)
 	return highest_score;
 }
 
+static void damos_goal_tune_esz_bp_consist(struct damos_quota *quota)
+{
+	unsigned long score = damos_quota_score(quota);
+
+	quota->esz_bp = 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 = damos_quota_score(quota);
+
+	if (score >= 10000)
+		quota->esz_bp = 0;
+	else if (quota->sz)
+		quota->esz_bp = quota->sz * 10000;
+	else
+		quota->esz_bp = ULONG_MAX;
+}
+
 /*
  * Called only if quota->ms, or quota->sz are set, or quota->goals is not empty
  */
@@ -2351,11 +2371,10 @@ static void damos_set_effective_quota(struct damos_quota *quota)
 	}
 
 	if (!list_empty(&quota->goals)) {
-		unsigned long score = damos_quota_score(quota);
-
-		quota->esz_bp = damon_feed_loop_next_input(
-				max(quota->esz_bp, 10000UL),
-				score);
+		if (quota->goal_tuner == DAMOS_QUOTA_GOAL_TUNER_CONSIST)
+			damos_goal_tune_esz_bp_consist(quota);
+		else if (quota->goal_tuner == DAMOS_QUOTA_GOAL_TUNER_TEMPORAL)
+			damos_goal_tune_esz_bp_temporal(quota);
 		esz = quota->esz_bp / 10000;
 	}
 
-- 
2.47.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [RFC PATCH v2 04/10] mm/damon/sysfs-schemes: implement quotas->goal_tuner file
  2026-03-04  4:41 [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms SeongJae Park
                   ` (2 preceding siblings ...)
  2026-03-04  4:41 ` [RFC PATCH v2 03/10] mm/damon/core: introduce DAMOS_QUOTA_GOAL_TUNER_TEMPORAL SeongJae Park
@ 2026-03-04  4:41 ` SeongJae Park
  2026-03-04  4:41 ` [RFC PATCH v2 05/10] Docs/mm/damon/design: document the goal-based quota tuner selections SeongJae Park
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: SeongJae Park @ 2026-03-04  4:41 UTC (permalink / raw)
  Cc: SeongJae Park, Andrew Morton, damon, linux-kernel, linux-mm

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 <sj@kernel.org>
---
 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;
 };
 
 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);
 }
 
+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[] = {
+	{
+		.tuner = DAMOS_QUOTA_GOAL_TUNER_CONSIST,
+		.name = "consist",
+	},
+	{
+		.tuner = DAMOS_QUOTA_GOAL_TUNER_TEMPORAL,
+		.name = "temporal",
+	},
+};
+
+static ssize_t goal_tuner_show(struct kobject *kobj,
+		struct kobj_attribute *attr, char *buf)
+{
+	struct damon_sysfs_quotas *quotas = container_of(kobj,
+			struct damon_sysfs_quotas, kobj);
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(damos_sysfs_qgoal_tuner_names); i++) {
+		struct damos_sysfs_qgoal_tuner_name *tuner_name;
+
+		tuner_name = &damos_sysfs_qgoal_tuner_names[i];
+		if (tuner_name->tuner == 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 = container_of(kobj,
+			struct damon_sysfs_quotas, kobj);
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(damos_sysfs_qgoal_tuner_names); i++) {
+		struct damos_sysfs_qgoal_tuner_name *tuner_name;
+
+		tuner_name = &damos_sysfs_qgoal_tuner_names[i];
+		if (sysfs_streq(buf, tuner_name->name)) {
+			quotas->goal_tuner = 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_reset_interval_ms_attr =
 static struct kobj_attribute damon_sysfs_quotas_effective_bytes_attr =
 		__ATTR_RO_MODE(effective_bytes, 0400);
 
+static struct kobj_attribute damon_sysfs_quotas_goal_tuner_attr =
+		__ATTR_RW_MODE(goal_tuner, 0600);
+
 static struct attribute *damon_sysfs_quotas_attrs[] = {
 	&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 = sysfs_weights->sz,
 		.weight_nr_accesses = sysfs_weights->nr_accesses,
 		.weight_age = sysfs_weights->age,
+		.goal_tuner = sysfs_quotas->goal_tuner,
 	};
 	struct damos_watermarks wmarks = {
 		.metric = sysfs_wmarks->metric,
-- 
2.47.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [RFC PATCH v2 05/10] Docs/mm/damon/design: document the goal-based quota tuner selections
  2026-03-04  4:41 [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms SeongJae Park
                   ` (3 preceding siblings ...)
  2026-03-04  4:41 ` [RFC PATCH v2 04/10] mm/damon/sysfs-schemes: implement quotas->goal_tuner file SeongJae Park
@ 2026-03-04  4:41 ` SeongJae Park
  2026-03-04  4:41 ` [RFC PATCH v2 06/10] Docs/admin-guide/mm/damon/usage: document goal_tuner sysfs file SeongJae Park
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: SeongJae Park @ 2026-03-04  4:41 UTC (permalink / raw)
  Cc: SeongJae Park, Liam R. Howlett, Andrew Morton, David Hildenbrand,
	Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
	Shuah Khan, Suren Baghdasaryan, Vlastimil Babka, damon,
	linux-doc, linux-kernel, linux-mm

Update the design document for the newly added goal-based quota tuner
selection feature.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 Documentation/mm/damon/design.rst | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.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.
 
+There are two such tuning algorithms that users can select as they need.
+
+- ``consist``: A proportional feedback loop based algorithm.  Tries to find an
+  optimum quota that should be consistently kept, to keep achieving the goal.
+  Useful for kernel-only operation on dynamic and long-running environments.
+  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 short
+  time.  When the quota is under-achieved, this algorithm keeps tuning quota 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
-- 
2.47.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [RFC PATCH v2 06/10] Docs/admin-guide/mm/damon/usage: document goal_tuner sysfs file
  2026-03-04  4:41 [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms SeongJae Park
                   ` (4 preceding siblings ...)
  2026-03-04  4:41 ` [RFC PATCH v2 05/10] Docs/mm/damon/design: document the goal-based quota tuner selections SeongJae Park
@ 2026-03-04  4:41 ` SeongJae Park
  2026-03-04  4:41 ` [RFC PATCH v2 07/10] Docs/ABI/damon: update for goal_tuner SeongJae Park
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: SeongJae Park @ 2026-03-04  4:41 UTC (permalink / raw)
  Cc: SeongJae Park, Liam R. Howlett, Andrew Morton, David Hildenbrand,
	Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
	Shuah Khan, Suren Baghdasaryan, Vlastimil Babka, damon,
	linux-doc, linux-kernel, linux-mm

Update the DAMON usage document for the new sysfs file for the goal
based quota auto-tuning algorithm selection.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 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/admin-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 (",").
     │ │ │ │ │ │ │ │ sz/min,max
     │ │ │ │ │ │ │ │ nr_accesses/min,max
     │ │ │ │ │ │ │ │ age/min,max
-    │ │ │ │ │ │ │ :ref:`quotas <sysfs_quotas>`/ms,bytes,reset_interval_ms,effective_bytes
+    │ │ │ │ │ │ │ :ref:`quotas <sysfs_quotas>`/ms,bytes,reset_interval_ms,effective_bytes,goal_tuner
     │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil
     │ │ │ │ │ │ │ │ :ref:`goals <sysfs_schemes_quota_goals>`/nr_goals
     │ │ │ │ │ │ │ │ │ 0/target_metric,target_value,current_value,nid,path
@@ -377,9 +377,9 @@ schemes/<N>/quotas/
 The directory for the :ref:`quotas <damon_design_damos_quotas>` of the given
 DAMON-based operation scheme.
 
-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.
 
 You can set the ``time quota`` in milliseconds, ``size quota`` in bytes, and
 ``reset interval`` in milliseconds by writing the values to the three files,
@@ -390,6 +390,14 @@ apply the action to only up to ``bytes`` bytes of memory regions within the
 quota limits unless at least one :ref:`goal <sysfs_schemes_quota_goals>` is
 set.
 
+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 returns
+the currently selected tuner algorithm.  Refer to the design documentation of
+:ref:`automatic quota tuning goals <damon_design_damos_quotas_auto_tuning>` for
+the background design of the feature and the name of the selectable algorithms.
+Refer to :ref:`goals directory <sysfs_schemes_quota_goals>` 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 applied.
 Based on the user-specified :ref:`goal <sysfs_schemes_quota_goals>`, the
-- 
2.47.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [RFC PATCH v2 07/10] Docs/ABI/damon: update for goal_tuner
  2026-03-04  4:41 [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms SeongJae Park
                   ` (5 preceding siblings ...)
  2026-03-04  4:41 ` [RFC PATCH v2 06/10] Docs/admin-guide/mm/damon/usage: document goal_tuner sysfs file SeongJae Park
@ 2026-03-04  4:41 ` SeongJae Park
  2026-03-04  4:41 ` [RFC PATCH v2 08/10] selftests/damon/_damon_sysfs: support goal_tuner setup SeongJae Park
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: SeongJae Park @ 2026-03-04  4:41 UTC (permalink / raw)
  Cc: SeongJae Park, damon, linux-kernel, linux-mm

Update the ABI document for the newly added goal_tuner sysfs file.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 Documentation/ABI/testing/sysfs-kernel-mm-damon | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-damon b/Documentation/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 <sj@kernel.org>
 Description:	Writing to and reading from this file sets and gets the path
 		parameter of the goal.
 
+What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/schemes/<S>/quotas/goal_tuner
+Date:		Mar 2026
+Contact:	SeongJae Park <sj@kernel.org>
+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/<K>/contexts/<C>/schemes/<S>/quotas/weights/sz_permil
 Date:		Mar 2022
 Contact:	SeongJae Park <sj@kernel.org>
-- 
2.47.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [RFC PATCH v2 08/10] selftests/damon/_damon_sysfs: support goal_tuner setup
  2026-03-04  4:41 [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms SeongJae Park
                   ` (6 preceding siblings ...)
  2026-03-04  4:41 ` [RFC PATCH v2 07/10] Docs/ABI/damon: update for goal_tuner SeongJae Park
@ 2026-03-04  4:41 ` SeongJae Park
  2026-03-04  4:41 ` [RFC PATCH v2 09/10] selftests/damon/drgn_dump_damon_status: support quota goal_tuner dumping SeongJae Park
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: SeongJae Park @ 2026-03-04  4:41 UTC (permalink / raw)
  Cc: SeongJae Park, Shuah Khan, damon, linux-kernel, linux-kselftest,
	linux-mm

Add support of goal_tuner setup to the test-purpose DAMON sysfs
interface control helper, _damon_sysfs.py.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 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 = None                   # size quota, in bytes
     ms = None                   # time quota
     goals = None                # quota goals
+    goal_tuner = None           # quota goal tuner
     reset_interval_ms = None    # quota reset interval
     weight_sz_permil = None
     weight_nr_accesses_permil = None
     weight_age_permil = None
     scheme = None               # owner scheme
 
-    def __init__(self, sz=0, ms=0, goals=None, reset_interval_ms=0,
-                 weight_sz_permil=0, weight_nr_accesses_permil=0,
-                 weight_age_permil=0):
+    def __init__(self, sz=0, ms=0, goals=None, goal_tuner='consist',
+                 reset_interval_ms=0, weight_sz_permil=0,
+                 weight_nr_accesses_permil=0, weight_age_permil=0):
         self.sz = sz
         self.ms = ms
         self.reset_interval_ms = reset_interval_ms
@@ -146,6 +147,7 @@ class DamosQuota:
         self.weight_nr_accesses_permil = weight_nr_accesses_permil
         self.weight_age_permil = weight_age_permil
         self.goals = goals if goals is not None else []
+        self.goal_tuner = goal_tuner
         for idx, goal in enumerate(self.goals):
             goal.idx = idx
             goal.quota = self
@@ -191,6 +193,10 @@ class DamosQuota:
             err = goal.stage()
             if err is not None:
                 return err
+        err = write_file(
+                os.path.join(self.sysfs_dir(), 'goal_tuner'), self.goal_tuner)
+        if err is not None:
+            return err
         return None
 
 class DamosWatermarks:
-- 
2.47.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [RFC PATCH v2 09/10] selftests/damon/drgn_dump_damon_status: support quota goal_tuner dumping
  2026-03-04  4:41 [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms SeongJae Park
                   ` (7 preceding siblings ...)
  2026-03-04  4:41 ` [RFC PATCH v2 08/10] selftests/damon/_damon_sysfs: support goal_tuner setup SeongJae Park
@ 2026-03-04  4:41 ` SeongJae Park
  2026-03-04  4:41 ` [RFC PATCH v2 10/10] selftests/damon/sysfs.py: test goal_tuner commit SeongJae Park
  2026-03-04 10:15 ` [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms Gutierrez Asier
  10 siblings, 0 replies; 13+ messages in thread
From: SeongJae Park @ 2026-03-04  4:41 UTC (permalink / raw)
  Cc: SeongJae Park, Shuah Khan, damon, linux-kernel, linux-kselftest,
	linux-mm

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 <sj@kernel.org>
---
 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/tools/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],
-- 
2.47.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [RFC PATCH v2 10/10] selftests/damon/sysfs.py: test goal_tuner commit
  2026-03-04  4:41 [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms SeongJae Park
                   ` (8 preceding siblings ...)
  2026-03-04  4:41 ` [RFC PATCH v2 09/10] selftests/damon/drgn_dump_damon_status: support quota goal_tuner dumping SeongJae Park
@ 2026-03-04  4:41 ` SeongJae Park
  2026-03-04 10:15 ` [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms Gutierrez Asier
  10 siblings, 0 replies; 13+ messages in thread
From: SeongJae Park @ 2026-03-04  4:41 UTC (permalink / raw)
  Cc: SeongJae Park, Shuah Khan, damon, linux-kernel, linux-kselftest,
	linux-mm

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 <sj@kernel.org>
---
 tools/testing/selftests/damon/sysfs.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/testing/selftests/damon/sysfs.py b/tools/testing/selftests/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'] == quota.sz, 'sz', dump)
     for idx, qgoal in enumerate(quota.goals):
         assert_quota_goal_committed(qgoal, dump['goals'][idx])
+    tuner_val = {
+            'consist': 0,
+            'temporal': 1,
+            }
+    assert_true(dump['goal_tuner'] == tuner_val[quota.goal_tuner],
+                'goal_tuner', dump)
     assert_true(dump['weight_sz'] == quota.weight_sz_permil, 'weight_sz', dump)
     assert_true(dump['weight_nr_accesses'] == quota.weight_nr_accesses_permil,
                 'weight_nr_accesses', dump)
@@ -231,6 +237,7 @@ def main():
                         metric='node_mem_used_bp',
                         target_value=9950,
                         nid=1)],
+                    goal_tuner='temporal',
                     reset_interval_ms=1500,
                     weight_sz_permil=20,
                     weight_nr_accesses_permil=200,
-- 
2.47.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms
  2026-03-04  4:41 [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms SeongJae Park
                   ` (9 preceding siblings ...)
  2026-03-04  4:41 ` [RFC PATCH v2 10/10] selftests/damon/sysfs.py: test goal_tuner commit SeongJae Park
@ 2026-03-04 10:15 ` Gutierrez Asier
  10 siblings, 0 replies; 13+ messages in thread
From: Gutierrez Asier @ 2026-03-04 10:15 UTC (permalink / raw)
  To: SeongJae Park
  Cc: Liam R. Howlett, Andrew Morton, David Hildenbrand,
	Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
	Shuah Khan, Shuah Khan, Suren Baghdasaryan, Vlastimil Babka,
	damon, linux-doc, linux-kernel, linux-kselftest, linux-mm

Hi SeongJae!

Nice idea for dynamic environments.

On 3/4/2026 7:41 AM, SeongJae Park wrote:
> Aim-oriented DAMOS quota auto-tuning uses a single tuning algorithm.
> The algorithm is designed to find a quota value that should be
> consistently kept for achieving the aimed goal for long term.  It is
> useful and reliable at automatically operating systems that have dynamic
> environments in the long term.
> 
> As always, however, no single algorithm fits all.  When the environment
> has static characteristics or there are control towers in not only the
> kernel space but also the user space, the algorithm shows some
> limitations.  In such environments, users want kernel work in a more
> short term deterministic way.  Actually there were at least two reports
> [1,2] of such cases.
> 
> Extend DAMOS quotas goal to support multiple quota tuning algorithms
> that users can select.  Keep the current algorithm as the default one,
> to not break the old users.  Also give it a name, "consist", as it is
> designed to "consistently" apply the DAMOS action.  And introduce a new
> tuning algorithm, namely "temporal".  It is designed to apply the DAMOS
> action only temporally, in a deterministic way.  In more detail, as long
> as the goal is under-achieved, it uses the maximum quota available.
> Once the goal is over-achieved, it sets the quota zero.

I'm not sure "temporal" is the best name for this type of behaviour.

How about "by_score?". For example, "damos_goal_tune_esz_bp_by_score" and
DAMOS_QUOTA_GOAL_TUNER_BY_SCORE.

> Tests
> =====
> 
> I confirmed the feature is working as expected using the latest version
> of DAMON user-space tool, like below.
> 
>     $ # start DAMOS for reclaiming memory aiming 30% free memory
>     $ sudo ./damo/damo start --damos_action pageout \
>             --damos_quota_goal_tuner temporal \
>             --damos_quota_goal node_mem_free_bp 30% 0 \
>             --damos_quota_interval 1s \
>             --damos_quota_space 100M
> 
> Note that >=3.1.8 version of DAMON user-space tool supports this feature
> (--damos_quota_goal_tuner).  As expected, DAMOS stops reclaiming memory
> as soon as the goal amount of free memory is made.  When 'consist' tuner
> is used, the reclamation was continued even after the goal amount of
> free memory is made, resulting in more than goal amount of free memory,
> as expected.
> 
> Patch Sequence
> ==============
> 
> First four patches implement the features.  Patch 1 extends core API to
> allow multiple tuners and make the current tuner as the default and only
> available tuner, namely 'consist'.  Patch 2 allows future tuners setting
> zero effective quota.  Patch 3 introduces the second tuner, namely
> 'temporal'.  Patch 4 further extends DAMON sysfs API to let users use
> that.
> 
> Three following patches (patches 5-7) update design, usage, and ABI
> documents, respectively.
> 
> Final three patches (patches 8-10) are for adding selftests.  The eighth
> and the ninth patches extend the testing-purpose DAMON sysfs control
> helper and DAMON status dumping tool to support the newly added feature.
> The tenth patch extends the existing online commit test to cover the new
> feature.
> 
> References
> ==========
> 
> [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
> 
> Changelog
> =========
> 
> Changes from RFC v1
> (https://lore.kernel.org/20260212062314.69961-1-sj@kernel.org)
> - Add selftest for goal_tuner commitment.
> - Set goal tuner inside damon_new_scheme().
> - Allow zero size effective size quota.
> - Update the ABI document.
> - Wordsmith change descriptions.
> 
> SeongJae Park (10):
>   mm/damon/core: introduce damos_quota_goal_tuner
>   mm/damon/core: allow quota goals set zero effective size quota
>   mm/damon/core: introduce DAMOS_QUOTA_GOAL_TUNER_TEMPORAL
>   mm/damon/sysfs-schemes: implement quotas->goal_tuner file
>   Docs/mm/damon/design: document the goal-based quota tuner selections
>   Docs/admin-guide/mm/damon/usage: document goal_tuner sysfs file
>   Docs/ABI/damon: update for goal_tuner
>   selftests/damon/_damon_sysfs: support goal_tuner setup
>   selftests/damon/drgn_dump_damon_status: support quota goal_tuner
>     dumping
>   selftests/damon/sysfs.py: test goal_tuner commit
> 
>  .../ABI/testing/sysfs-kernel-mm-damon         |  6 ++
>  Documentation/admin-guide/mm/damon/usage.rst  | 16 +++--
>  Documentation/mm/damon/design.rst             | 12 ++++
>  include/linux/damon.h                         | 11 ++++
>  mm/damon/core.c                               | 60 +++++++++++++++----
>  mm/damon/sysfs-schemes.c                      | 58 ++++++++++++++++++
>  tools/testing/selftests/damon/_damon_sysfs.py | 12 +++-
>  .../selftests/damon/drgn_dump_damon_status.py |  1 +
>  tools/testing/selftests/damon/sysfs.py        |  7 +++
>  9 files changed, 166 insertions(+), 17 deletions(-)
> 
> 
> base-commit: bbba4ca6322dd5c4f66fe31b1b374f77a8d2b2e5

-- 
Asier Gutierrez
Huawei



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC PATCH v2 02/10] mm/damon/core: allow quota goals set zero effective size quota
  2026-03-04  4:41 ` [RFC PATCH v2 02/10] mm/damon/core: allow quota goals set zero effective size quota SeongJae Park
@ 2026-03-04 10:18   ` Gutierrez Asier
  0 siblings, 0 replies; 13+ messages in thread
From: Gutierrez Asier @ 2026-03-04 10:18 UTC (permalink / raw)
  To: SeongJae Park; +Cc: Andrew Morton, damon, linux-kernel, linux-mm



On 3/4/2026 7:41 AM, SeongJae Park wrote:

I find the name of this function confusing. The function doesn't
actually set anything. Maybe better damos_quota_is_set()
> +/*
> + * damos_quota_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_set(struct damos_quota *quota)
> +{
> +	return quota->esz || quota->sz || quota->ms ||
> +		!damos_quota_goals_empty(quota);
> +}
> +


-- 
Asier Gutierrez
Huawei



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-03-04 10:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-04  4:41 [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms SeongJae Park
2026-03-04  4:41 ` [RFC PATCH v2 01/10] mm/damon/core: introduce damos_quota_goal_tuner SeongJae Park
2026-03-04  4:41 ` [RFC PATCH v2 02/10] mm/damon/core: allow quota goals set zero effective size quota SeongJae Park
2026-03-04 10:18   ` Gutierrez Asier
2026-03-04  4:41 ` [RFC PATCH v2 03/10] mm/damon/core: introduce DAMOS_QUOTA_GOAL_TUNER_TEMPORAL SeongJae Park
2026-03-04  4:41 ` [RFC PATCH v2 04/10] mm/damon/sysfs-schemes: implement quotas->goal_tuner file SeongJae Park
2026-03-04  4:41 ` [RFC PATCH v2 05/10] Docs/mm/damon/design: document the goal-based quota tuner selections SeongJae Park
2026-03-04  4:41 ` [RFC PATCH v2 06/10] Docs/admin-guide/mm/damon/usage: document goal_tuner sysfs file SeongJae Park
2026-03-04  4:41 ` [RFC PATCH v2 07/10] Docs/ABI/damon: update for goal_tuner SeongJae Park
2026-03-04  4:41 ` [RFC PATCH v2 08/10] selftests/damon/_damon_sysfs: support goal_tuner setup SeongJae Park
2026-03-04  4:41 ` [RFC PATCH v2 09/10] selftests/damon/drgn_dump_damon_status: support quota goal_tuner dumping SeongJae Park
2026-03-04  4:41 ` [RFC PATCH v2 10/10] selftests/damon/sysfs.py: test goal_tuner commit SeongJae Park
2026-03-04 10:15 ` [RFC PATCH v2 00/10] mm/damon: support multiple goal-based quota tuning algorithms Gutierrez Asier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox