]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
mm/page_alloc.c: broken deferred calculation
authorPavel Tatashin <pasha.tatashin@oracle.com>
Thu, 16 Nov 2017 01:38:41 +0000 (17:38 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 14 Mar 2018 10:41:57 +0000 (11:41 +0100)
commite53e71cb231bb30342f8da3b2fe27935a547aff9
tree1e5de39c48be82b9931e149576a427b08b273d24
parentffb3a56f1f349859cbd8b257acbb22e300416e1c
mm/page_alloc.c: broken deferred calculation

BugLink: http://bugs.launchpad.net/bugs/1744213
commit d135e5750205a21a212a19dbb05aeb339e2cbea7 upstream.

In reset_deferred_meminit() we determine number of pages that must not
be deferred.  We initialize pages for at least 2G of memory, but also
pages for reserved memory in this node.

The reserved memory is determined in this function:
memblock_reserved_memory_within(), which operates over physical
addresses, and returns size in bytes.  However, reset_deferred_meminit()
assumes that that this function operates with pfns, and returns page
count.

The result is that in the best case machine boots slower than expected
due to initializing more pages than needed in single thread, and in the
worst case panics because fewer than needed pages are initialized early.

Link: http://lkml.kernel.org/r/20171021011707.15191-1-pasha.tatashin@oracle.com
Fixes: 864b9a393dcb ("mm: consider memblock reservations for deferred memory initialization sizing")
Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
include/linux/mmzone.h
mm/page_alloc.c