path: root/init
diff options
authorMel Gorman <>2015-06-30 14:57:27 -0700
committerLinus Torvalds <>2015-06-30 19:44:56 -0700
commit0e1cc95b4cc7293bb7b39175035e7f7e45c90977 (patch)
tree61b1173bce0ef2738aec4259956c1ecc52280dfa /init
parent74033a798f5a5db368126ee6f690111cf019bf7a (diff)
mm: meminit: finish initialisation of struct pages before basic setup
Waiman Long reported that 24TB machines hit OOM during basic setup when struct page initialisation was deferred. One approach is to initialise memory on demand but it interferes with page allocator paths. This patch creates dedicated threads to initialise memory before basic setup. It then blocks on a rw_semaphore until completion as a wait_queue and counter is overkill. This may be slower to boot but it's simplier overall and also gets rid of a section mangling which existed so kswapd could do the initialisation. [ include rwsem.h, use DECLARE_RWSEM, fix comment, remove unneeded cast] Signed-off-by: Mel Gorman <> Cc: Waiman Long < Cc: Nathan Zimmer <> Cc: Dave Hansen <> Cc: Scott Norton <> Tested-by: Daniel J Blueman <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'init')
1 files changed, 2 insertions, 0 deletions
diff --git a/init/main.c b/init/main.c
index c599aea23bb1..c5d5626289ce 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1004,6 +1004,8 @@ static noinline void __init kernel_init_freeable(void)
+ page_alloc_init_late();
/* Open the /dev/console on the rootfs, this should never fail */