Messages in this thread | | | From | SeongJae Park <> | Subject | Re: [PATCH v2] mm/damon/core: Optimize kdamod.%d thread creation code | Date | Tue, 19 Oct 2021 10:03:36 +0000 |
| |
Hello Xin,
On Sun, 17 Oct 2021 00:59:14 +0800 Xin Hao <xhao@linux.alibaba.com> wrote:
> When the ctx->adaptive_targets list is empty, > i did some test on monitor_on interface like this. > > echo on > /sys/kernel/debug/damon/monitor_on > [ 851.988307] damon: kdamond (5390) starts > > Though the ctx->adaptive_targets list is empty, but the > kthread_run still be called, and the kdamond.x thread still > be created, this is meaningless.
Good finding, thank you!
> > So there adds a judgment. only if the ctx->adaptive_targets > list is not empty, and ctx->kdamond pointer is NULL, then call > the __damon_start function.
I think we cannot believe user-space users, but kernel-space API users. How about adding the check in 'dbgfs_monitor_on_write()' rather than '__damon_start()'?
Also, apparently this patch is based on latest 'damon/next' branch of my tree. Could you please rebase this on latest -mm tree?
Thanks, SJ
[...]
| |