mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 17:32:32 +00:00
Commit059342d1dd("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/[email protected]/ Link: https://lkml.kernel.org/r/[email protected] Fixes:059342d1dd("mm/damon/reclaim: fix the timer always stays active") Signed-off-by: SeongJae Park <[email protected]> Reported-by: Greg White <[email protected]> Cc: Hailong Tu <[email protected]> Signed-off-by: Andrew Morton <[email protected]>