diff options
author | Huaisheng Ye <huaisheng.ye@intel.com> | 2023-01-16 07:23:47 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-02-03 07:33:22 +0100 |
commit | 64517d6e1291b5e942b00c53674ecf33f918313f (patch) | |
tree | 777f5e1ab43bb4ee40ea2ba95964f6625bbcfee2 /mm/damon | |
parent | mm/secretmem: remove redundant initiialization of pointer file (diff) | |
download | linux-64517d6e1291b5e942b00c53674ecf33f918313f.tar.xz linux-64517d6e1291b5e942b00c53674ecf33f918313f.zip |
mm/damon/core: skip apply schemes if empty
Sometimes there is no scheme in damon's context, for example just use damo
record to monitor workload's data access pattern.
If current damon context doesn't have any scheme in the list, kdamond has
no need to iterate over list of all targets and regions but do nothing.
So, skip apply schemes when ctx->schemes is empty.
Link: https://lkml.kernel.org/r/20230116062347.1148553-1-huaisheng.ye@intel.com
Signed-off-by: Huaisheng Ye <huaisheng.ye@intel.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/damon')
-rw-r--r-- | mm/damon/core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/damon/core.c b/mm/damon/core.c index 1bf0654ae189..2db8c53491ca 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1269,7 +1269,8 @@ static int kdamond_fn(void *data) if (ctx->callback.after_aggregation && ctx->callback.after_aggregation(ctx)) break; - kdamond_apply_schemes(ctx); + if (!list_empty(&ctx->schemes)) + kdamond_apply_schemes(ctx); kdamond_reset_aggregated(ctx); kdamond_split_regions(ctx); if (ctx->ops.reset_aggregated) |