mm/damon/core: check apply interval in damon_do_apply_schemes()
authorSeongJae Park <sj@kernel.org>
Mon, 5 Feb 2024 20:13:06 +0000 (12:13 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 20 Feb 2024 22:20:47 +0000 (14:20 -0800)
commite9e3db69966d5e9e6f7e7d017b407c0025180fe5
treeac82b6f03101f3dc24037574251560ce4851d046
parente3b63e966cac0bf78aaa1efede1827a252815a1d
mm/damon/core: check apply interval in damon_do_apply_schemes()

kdamond_apply_schemes() checks apply intervals of schemes and avoid
further applying any schemes if no scheme passed its apply interval.
However, the following schemes applying function, damon_do_apply_schemes()
iterates all schemes without the apply interval check.  As a result, the
shortest apply interval is applied to all schemes.  Fix the problem by
checking the apply interval in damon_do_apply_schemes().

Link: https://lkml.kernel.org/r/20240205201306.88562-1-sj@kernel.org
Fixes: 42f994b71404 ("mm/damon/core: implement scheme-specific apply interval")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org> [6.7.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/core.c