]> www.infradead.org Git - users/willy/linux.git/commit
mm: use common iterator for deferred_init_pages and deferred_free_pages
authorAlexander Duyck <alexander.h.duyck@linux.intel.com>
Wed, 5 Dec 2018 00:14:01 +0000 (11:14 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 6 Dec 2018 22:08:49 +0000 (09:08 +1100)
commitdbf0a562b457e257a515f192315dda4a4d76d5cd
tree34e6901477070cf68c7c296c424c78a3b0b1f840
parent41b1e9969db5d303f12e96f77dda57eccdefda52
mm: use common iterator for deferred_init_pages and deferred_free_pages

Create a common iterator to be used by both deferred_init_pages() and
deferred_free_pages().  By doing this we can cut down a bit on code
overhead as they will likely both be inlined into the same function
anyway.

This new approach allows deferred_init_pages to make use of
__init_pageblock().  By doing this we can cut down on the code size by
sharing code between both the hotplug and deferred memory init code paths.

An additional benefit to this approach is that we improve in cache
locality of the memory init as we can focus on the memory areas related to
identifying if a given PFN is valid and keep that warm in the cache until
we transition to a region of a different type.  So we will stream through
a chunk of valid blocks before we turn to initializing page structs.

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

Link: http://lkml.kernel.org/r/154361480390.7497.9730184349746888133.stgit@ahduyck-desk1.amr.corp.intel.com
Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Reviewed-by: Pavel Tatashin <pavel.tatashin@microsoft.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Khalid Aziz <khalid.aziz@oracle.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
mm/page_alloc.c