linux-stable/mm/damon
SeongJae Park 2949282938 mm/damon/reclaim: schedule 'damon_reclaim_timer' only after 'system_wq' is initialized
Commit 059342d1dd ("mm/damon/reclaim: fix the timer always stays
active") made DAMON_RECLAIM's 'enabled' parameter store callback,
'enabled_store()', to schedule 'damon_reclaim_timer'.  The scheduling uses
'system_wq', which is initialized in 'workqueue_init_early()'.  As kernel
parameters parsing function ('parse_args()') is called before
'workqueue_init_early()', 'enabled_store()' can be executed before
'workqueue_init_early()' and end up accessing the uninitialized
'system_wq'.  As a result, the booting hang[1].  This commit fixes the
issue by checking if the initialization is done before scheduling the
timer.

[1] https://lkml.kernel.org/20220604192222.1488-1-sj@kernel.org/

Link: https://lkml.kernel.org/r/20220604195051.1589-1-sj@kernel.org
Fixes: 059342d1dd ("mm/damon/reclaim: fix the timer always stays active")
Signed-off-by: SeongJae Park <sj@kernel.org>
Reported-by: Greg White <gwhite@kupulau.com>
Cc: Hailong Tu <tuhailong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-06-16 19:11:30 -07:00
..
Kconfig mm/damon: implement a minimal stub for sysfs-based DAMON interface 2022-03-22 15:57:13 -07:00
Makefile mm/damon: implement a minimal stub for sysfs-based DAMON interface 2022-03-22 15:57:13 -07:00
core-test.h mm/damon/core-test: add a kunit test case for ops registration 2022-04-29 14:37:00 -07:00
core.c mm/damon/vaddr: move 'damon_set_regions()' to core 2022-05-13 07:20:08 -07:00
dbgfs-test.h mm/damon/dbgfs-test: fix is_target_id() change 2022-03-22 15:57:12 -07:00
dbgfs.c mm/damon/core: allow non-exclusive DAMON start/stop 2022-03-22 15:57:13 -07:00
ops-common.c mm: damon: use HPAGE_PMD_SIZE 2022-05-19 14:08:55 -07:00
ops-common.h mm/damon: rename damon_primitives to damon_operations 2022-03-22 15:57:12 -07:00
paddr.c mm: damon: use HPAGE_PMD_SIZE 2022-05-19 14:08:55 -07:00
reclaim.c mm/damon/reclaim: schedule 'damon_reclaim_timer' only after 'system_wq' is initialized 2022-06-16 19:11:30 -07:00
sysfs.c mm/damon/sysfs: support online inputs update 2022-05-13 07:20:09 -07:00
vaddr-test.h mm/damon/vaddr: remove damon_va_apply_three_regions() 2022-05-13 07:20:08 -07:00
vaddr.c mm: damon: use HPAGE_PMD_SIZE 2022-05-19 14:08:55 -07:00