[RFC PATCH v1.2 05/12] mm/damon/sysfs: remove probes number validation

From: SJ Park

Date: Wed Jul 29 2026 - 10:16:38 EST


DAMON sysfs interface is disallowing >DAMON_MAX_PROBES nr_probes input,
since DAMON_MAX_PROBES is the upper limit of probes per DAMON context.
The core layer is validating the upper limit again, though. It is
preferred to let DAMON API callers such as sysfs interface to set
parameters in flexible ways, and do parameters validation in the core
layer. Drop the duplicated validation in the sysfs interface.

Signed-off-by: SJ Park <sj@xxxxxxxxxx>
---
mm/damon/sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
index d02f5f8ceae5b..8abda69c98dd1 100644
--- a/mm/damon/sysfs.c
+++ b/mm/damon/sysfs.c
@@ -1477,7 +1477,7 @@ static ssize_t nr_probes_store(struct kobject *kobj,

if (err)
return err;
- if (nr < 0 || nr > DAMON_MAX_PROBES)
+ if (nr < 0)
return -EINVAL;

probes = container_of(kobj, struct damon_sysfs_probes, kobj);
--
2.47.3