]> Git Repo - linux.git/commit
mm: initialize MAX_ORDER_NR_PAGES at a time instead of doing larger sections
authorAlexander Duyck <[email protected]>
Tue, 14 May 2019 00:21:20 +0000 (17:21 -0700)
committerLinus Torvalds <[email protected]>
Tue, 14 May 2019 16:47:49 +0000 (09:47 -0700)
commit0e56acae4b4dd4a9fbe897854ab83a109e2a9e11
treeeadb00b06fe96f05be4b191bbb15374f212cbab8
parent837566e7e08e3f89444166444836a8a49b9f9322
mm: initialize MAX_ORDER_NR_PAGES at a time instead of doing larger sections

Add yet another iterator, for_each_free_mem_range_in_zone_from, and then
use it to support initializing and freeing pages in groups no larger than
MAX_ORDER_NR_PAGES.  By doing this we can greatly improve the cache
locality of the pages while we do several loops over them in the init and
freeing process.

We are able to tighten the loops further as a result of the "from"
iterator as we can perform the initial checks for first_init_pfn in our
first call to the iterator, and continue without the need for those checks
via the "from" iterator.  I have added this functionality in the function
called deferred_init_mem_pfn_range_in_zone that primes the iterator and
causes us to exit if we encounter any failure.

On my x86_64 test system with 384GB of memory per node I saw a reduction
in initialization time from 1.85s to 1.38s as a result of this patch.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Alexander Duyck <[email protected]>
Reviewed-by: Pavel Tatashin <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Dave Jiang <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: <[email protected]>
Cc: Khalid Aziz <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Laurent Dufour <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: "Kirill A. Shutemov" <[email protected]>
Cc: Pavel Tatashin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/memblock.h
mm/page_alloc.c
This page took 0.057239 seconds and 4 git commands to generate.