Re: [RFC PATCH 14/27] mm/damon/paddr: support REPORT_MADE type probe filter
From: Aveline Noir
Date: Mon Nov 16 2026 - 02:46:19 EST
Hi SJ,
On Sun, 15 Nov 2026 12:28:32 -0800 SJ Park wrote:
> + case DAMON_FILTER_TYPE_REPORT_MADE:
> + addr_range.start = pa;
> + addr_range.end = pa + 1;
> + matched = damon_report_exist(filter->report_type, &addr_range,
> + jiffies -
> + usecs_to_jiffies(ctx->attrs.sample_interval));
Since the window is counted in jiffies and rounded up, how many samples
see a given report depends on HZ. With the default 5 ms sampling
interval, the window is 2 jiffies at HZ=250, i.e. 8 to 12 ms, so a
report is usually seen by two consecutive samples. At HZ=1000 the
window is 5 jiffies, but kdamond_usleep() sleeps via
schedule_timeout_idle() there, and samples end up about 6 ms apart, so
a report made right after a sample can fall out of the window before
the next one.
With the queue indexing fixed, user reports submitted every 50 or
250 ms and covering the whole physical address range were counted
about 2.0 times each on an x86_64 guest at HZ=250, and about 0.84
times at HZ=1000.
Is this approximation intended? If each report is meant to be counted
once, maybe we could keep a per-context report sequence cursor and
check only the reports enqueued since the previous probe run. A quick
local hack of that counted each report once on both HZ values. If
reports are rather meant to stay valid for a while, like a user saying
a range is hot, a validity period separate from the sampling interval
might fit better.
Thanks,
Aveline Noir