mirror of
https://github.com/torvalds/linux.git
synced 2025-04-09 14:45:27 +00:00
mm/damon/core: do not call damos_walk_control->walk() if walk is completed
damos_walk() invokes callback functions of schemes until all schemes finishes at least one round of walks. If there are multiple DAMOS schemes having different apply_interval, the callback functions for longer apply interval scheme will be called for more than a round of the walk. The behavior is different from the document (see damos_walk() kernel-doc comment), and not useful. Make the behavior be same to the documented one, by stopping invoking the callback if the walk for the given scheme is completed. Link: https://lkml.kernel.org/r/20250210182737.134994-3-sj@kernel.org Fixes: bf0eaba0ff9c ("mm/damon/core: implement damos_walk()") Signed-off-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
c32696ca5e
commit
40eb655b41
@ -1458,6 +1458,9 @@ static void damos_walk_call_walk(struct damon_ctx *ctx, struct damon_target *t,
|
||||
{
|
||||
struct damos_walk_control *control;
|
||||
|
||||
if (s->walk_completed)
|
||||
return;
|
||||
|
||||
mutex_lock(&ctx->walk_control_lock);
|
||||
control = ctx->walk_control;
|
||||
mutex_unlock(&ctx->walk_control_lock);
|
||||
|
Loading…
x
Reference in New Issue
Block a user