mm/damon/core: skip apply schemes if empty
authorHuaisheng Ye <huaisheng.ye@intel.com>
Mon, 16 Jan 2023 06:23:47 +0000 (14:23 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 3 Feb 2023 06:33:22 +0000 (22:33 -0800)
commit64517d6e1291b5e942b00c53674ecf33f918313f
tree777f5e1ab43bb4ee40ea2ba95964f6625bbcfee2
parent98001fd63d59d2f99c90db823d322de91ff7d771
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>
mm/damon/core.c