OSDN Git Service

mm/damon: simplify stop mechanism
authorChangbin Du <changbin.du@gmail.com>
Fri, 5 Nov 2021 20:48:22 +0000 (13:48 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 6 Nov 2021 20:30:46 +0000 (13:30 -0700)
commit0f91d13366a402420bf98eaaf393db03946c13e0
treebc10841661e60314e68754fbda0ffb41353509c4
parent0d16cfd46b48689de6a5ca594bc1a68105f6658b
mm/damon: simplify stop mechanism

A kernel thread can exit gracefully with kthread_stop().  So we don't
need a new flag 'kdamond_stop'.  And to make sure the task struct is not
freed when accessing it, get reference to it before termination.

Link: https://lkml.kernel.org/r/20211027130517.4404-1-changbin.du@gmail.com
Signed-off-by: Changbin Du <changbin.du@gmail.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/damon.h
mm/damon/core.c