Re: [PATCH 1/2] mm/damon/core: optimize kdamond_ap ply_schemes() by inverting scheme and region loops

From: SeongJae Park

Date: Mon Mar 23 2026 - 10:13:41 EST


On Sun, 22 Mar 2026 22:39:11 +0000 Josh Law <objecting@xxxxxxxxxxxxx> wrote:
[...]
> Hi SeongJae,
> ​I understand your concerns regarding the behavioral changes and the adaptive regions mechanism. If the loop inversion is too intrusive for the current DAMOS semantics, I agree it's better not to force it.
>
> ​Your suggestion to optimize the first loop by pre-filtering active schemes into a temporary list/array is interesting. It would achieve the O(Targets * Regions) skip for inactive schemes without changing the application order for active ones.
>
> ​I'll take a look at whether that can be implemented simply enough to justify the overhead of managing the temporary list. If it looks too complex, I'll move on to other areas as you suggested.

Sounds good!

> ​Thanks for the detailed feedback and the guidance on DAMON's scaling philosophy.

No worries, I'm glad to help.


Thanks,
SJ

[...]