diff options
author | Michal Hocko <mhocko@suse.com> | 2017-03-19 21:01:27 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-03-19 21:01:27 +1100 |
commit | 5089cb0d88750c967e7c69352350dd398727a95e (patch) | |
tree | 299d1bb6b92676b083b6a5c0dbc974a4ac6c9c66 /init | |
parent | 1eb0db099f916d21384840f38ed8b8f2bc04fccb (diff) |
mm: move mm_percpu_wq initialization earlier
Yang Li has reported that drain_all_pages triggers a WARN_ON which means
that this function is called earlier than the mm_percpu_wq is initialized
on arm64 with CMA configured:
[ 0.276449] WARNING: CPU: 2 PID: 1 at mm/page_alloc.c:2423 drain_all_pages+0x244/0x25c
[ 0.276537] Modules linked in:
[ 0.276594] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.11.0-rc1-next-20170310-00027-g64dfbc5 #127
[ 0.276693] Hardware name: Freescale Layerscape 2088A RDB Board (DT)
[ 0.276764] task: ffffffc07c4a6d00 task.stack: ffffffc07c4a8000
[ 0.276831] PC is at drain_all_pages+0x244/0x25c
[ 0.276886] LR is at start_isolate_page_range+0x14c/0x1f0
[...]
[ 0.279000] [<ffffff80081636bc>] drain_all_pages+0x244/0x25c
[ 0.279065] [<ffffff80081c675c>] start_isolate_page_range+0x14c/0x1f0
[ 0.279137] [<ffffff8008166a48>] alloc_contig_range+0xec/0x354
[ 0.279203] [<ffffff80081c6c5c>] cma_alloc+0x100/0x1fc
[ 0.279263] [<ffffff8008481714>] dma_alloc_from_contiguous+0x3c/0x44
[ 0.279336] [<ffffff8008b25720>] atomic_pool_init+0x7c/0x208
[ 0.279399] [<ffffff8008b258f0>] arm64_dma_init+0x44/0x4c
[ 0.279461] [<ffffff8008083144>] do_one_initcall+0x38/0x128
[ 0.279525] [<ffffff8008b20d30>] kernel_init_freeable+0x1a0/0x240
[ 0.279596] [<ffffff8008807778>] kernel_init+0x10/0xfc
[ 0.279654] [<ffffff8008082b70>] ret_from_fork+0x10/0x20
Fix this by moving the whole setup_vmstat which is an initcall right now
to init_mm_internals which will be called right after the WQ subsystem is
initialized.
Link: http://lkml.kernel.org/r/20170315164021.28532-1-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Reported-by: Yang Li <pku.leo@gmail.com>
Tested-by: Yang Li <pku.leo@gmail.com>
Tested-by: Xiaolong Ye <xiaolong.ye@intel.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'init')
-rw-r--r-- | init/main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/init/main.c b/init/main.c index f9c9d9948203..b0c11cbf5ddf 100644 --- a/init/main.c +++ b/init/main.c @@ -1022,6 +1022,8 @@ static noinline void __init kernel_init_freeable(void) workqueue_init(); + init_mm_internals(); + do_pre_smp_initcalls(); lockup_detector_init(); |