[PATCH v2] mm/damon: document that a zero sample_interval is accepted

Karthikeyan KS posted 1 patch 6 days, 9 hours ago
include/linux/damon.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH v2] mm/damon: document that a zero sample_interval is accepted
Posted by Karthikeyan KS 6 days, 9 hours ago
damon_set_attrs() accepts sample_interval == 0.  This was reported as
a bug in v1 of this patch (rejecting it in damon_set_attrs()).  A
similar patch was already declined for the same reason: a zero
interval is intentionally supported [1].

Document the behavior instead of changing it.

[1] https://lore.kernel.org/all/20260722094304.3132750-1-dayou5941@163.com/

Signed-off-by: Karthikeyan KS <karthiproffesional@gmail.com>
---

Hi SJ,

> I'd prefer adding a comment saying zero sampling interval is
> accepted.  I think damon_attr kernel-doc comment is a good place
> for adding that.

Adding comments instead of code changes.  Let me know if you'd
rather the wording live somewhere else, or be phrased differently.

Changes from v1:
- Dropped the damon_set_attrs() rejection and the KUnit cases that
  tested it.
- Added a kernel-doc note on struct damon_attrs's @sample_interval
  instead.

Thanks,
Karthikeyan KS

 include/linux/damon.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/damon.h b/include/linux/damon.h
index 0c8b7ddef9ab..1a7ef416ec46 100644
--- a/include/linux/damon.h
+++ b/include/linux/damon.h
@@ -787,7 +787,8 @@ struct damon_probe {
 /**
  * struct damon_attrs - Monitoring attributes for accuracy/overhead control.
  *
- * @sample_interval:		The time between access samplings.
+ * @sample_interval:		The time between access samplings.  Zero is
+ *				accepted.
  * @aggr_interval:		The time between monitor results aggregations.
  * @ops_update_interval:	The time between monitoring operations updates.
  * @intervals_goal:		Intervals auto-tuning goal.
-- 
2.34.1
Re: [PATCH v2] mm/damon: document that a zero sample_interval is accepted
Posted by SJ Park 6 days, 9 hours ago
Hello Karthikeyan,


From the next time, please don't post a new version of a patch as a reply to
the thread.  Post it as a new thread instead.  Also please add a links to the
previous revisions in the changelog [1].

On Fri, 18 Sep 2026 13:13:01 +0000 Karthikeyan KS <karthiproffesional@gmail.com> wrote:

> damon_set_attrs() accepts sample_interval == 0.  This was reported as
> a bug in v1 of this patch (rejecting it in damon_set_attrs()).  A
> similar patch was already declined for the same reason: a zero
> interval is intentionally supported [1].
> 
> Document the behavior instead of changing it.
> 
> [1] https://lore.kernel.org/all/20260722094304.3132750-1-dayou5941@163.com/

The patch itself looks good to me.

> 
> Signed-off-by: Karthikeyan KS <karthiproffesional@gmail.com>

Reviewed-by: SJ Park <sj@kernel.org>

This patch is applied to damon/next [2] tree.  If this patch is not added to
mm.git in short term (~1 week?), I will ask mm.git maintainer (Andrew Morton)
to pick this.  So, no action from your side is needed for now.  If it seems I
also forgot doing that or you cannot wait for my action, please feel free to
directly ask that to Andrew.

> ---
> 
> Hi SJ,
> 
> > I'd prefer adding a comment saying zero sampling interval is
> > accepted.  I think damon_attr kernel-doc comment is a good place
> > for adding that.
> 
> Adding comments instead of code changes.  Let me know if you'd
> rather the wording live somewhere else, or be phrased differently.
> 
> Changes from v1:
> - Dropped the damon_set_attrs() rejection and the KUnit cases that
>   tested it.
> - Added a kernel-doc note on struct damon_attrs's @sample_interval
>   instead.

Thank you for accepting my humble suggestion.

[1] https://docs.kernel.org/process/submitting-patches.html#commentary
[2] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees



Thanks,
SJ

[...]
Re: [PATCH v2] mm/damon: document that a zero sample_interval is accepted
Posted by Karthikeyan KS 6 days, 5 hours ago
Hi SJ, hi Sang-Heon,

Thanks -- appreciate the review, and the pointer to the July thread.
Will post as a new thread with a link to the previous
version next time.

Thanks,
Karthikeyan KS