• Mel Gorman's avatar
    mm: meminit: finish initialisation of struct pages before basic setup · 0e1cc95b
    Mel Gorman authored
    
    
    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.
    
    [akpm@linux-foundation.org: include rwsem.h, use DECLARE_RWSEM, fix comment, remove unneeded cast]
    Signed-off-by: default avatarMel Gorman <mgorman@suse.de>
    Cc: Waiman Long <waiman.long@hp.com
    Cc: Nathan Zimmer <nzimmer@sgi.com>
    Cc: Dave Hansen <dave.hansen@intel.com>
    Cc: Scott Norton <scott.norton@hp.com>
    Tested-by: default avatarDaniel J Blueman <daniel@numascale.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    0e1cc95b
page_alloc.c 192 KB