mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
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: 42f994b714 ("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>
This commit is contained in:
parent
e3b63e966c
commit
e9e3db6996
|
|
@ -1026,6 +1026,9 @@ static void damon_do_apply_schemes(struct damon_ctx *c,
|
|||
damon_for_each_scheme(s, c) {
|
||||
struct damos_quota *quota = &s->quota;
|
||||
|
||||
if (c->passed_sample_intervals != s->next_apply_sis)
|
||||
continue;
|
||||
|
||||
if (!s->wmarks.activated)
|
||||
continue;
|
||||
|
||||
|
|
@ -1176,10 +1179,6 @@ static void kdamond_apply_schemes(struct damon_ctx *c)
|
|||
if (c->passed_sample_intervals != s->next_apply_sis)
|
||||
continue;
|
||||
|
||||
s->next_apply_sis +=
|
||||
(s->apply_interval_us ? s->apply_interval_us :
|
||||
c->attrs.aggr_interval) / sample_interval;
|
||||
|
||||
if (!s->wmarks.activated)
|
||||
continue;
|
||||
|
||||
|
|
@ -1195,6 +1194,14 @@ static void kdamond_apply_schemes(struct damon_ctx *c)
|
|||
damon_for_each_region_safe(r, next_r, t)
|
||||
damon_do_apply_schemes(c, t, r);
|
||||
}
|
||||
|
||||
damon_for_each_scheme(s, c) {
|
||||
if (c->passed_sample_intervals != s->next_apply_sis)
|
||||
continue;
|
||||
s->next_apply_sis +=
|
||||
(s->apply_interval_us ? s->apply_interval_us :
|
||||
c->attrs.aggr_interval) / sample_interval;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user