Re: [PATCH v4 2/2] mm/damon/core: Copy only installed probe in damon_split_region_at()

From: SJ Park

Date: Thu Oct 15 2026 - 10:32:31 EST


On Thu, 15 Oct 2026 19:27:54 +0530 Suhaas Joshi <suhaas@xxxxxxxxxx> wrote:

> In damon_split_region_at(), we copy the entire probe_hits[] and
> last_probe_hits[] arrays of DAMON_MAX_PROBES size. However it is possible
> that the number of probes installed is less than DAMON_MAX_PROBES, in which
> case one or more iterations is/are redundant. To remedy this, iterate over
> only as many times as the number of installed probes. To do so, accept a
> struct damon_ctx pointer in damon_split_region_at(), and update all
> invocations of the function to pass the new argument.
>
> Also update damon_test_split_at() and damos_test_filter_out() in
> core-kunit.h to supply a context to function paths that call
> damon_split_region_at().

Looks good to me. Thank you for this patch.

>
> Signed-off-by: Suhaas Joshi <suhaas@xxxxxxxxxx>

Reviewed-by: SJ Park <sj@xxxxxxxxxx>


Thanks,
SJ

[...]