]> Git Repo - linux.git/commit
mm: defer ZONE_DEVICE page initialization to the point where we init pgmap
authorAlexander Duyck <[email protected]>
Fri, 26 Oct 2018 22:07:52 +0000 (15:07 -0700)
committerLinus Torvalds <[email protected]>
Fri, 26 Oct 2018 23:26:34 +0000 (16:26 -0700)
commit966cf44f637e6aeea7e3d01ba004bf8b5beac78f
tree41b6c1bacf9f3151bc231691541823d05e4465e8
parentd483da5bc78b86fe4200d2947f193a745f711713
mm: defer ZONE_DEVICE page initialization to the point where we init pgmap

The ZONE_DEVICE pages were being initialized in two locations.  One was
with the memory_hotplug lock held and another was outside of that lock.
The problem with this is that it was nearly doubling the memory
initialization time.  Instead of doing this twice, once while holding a
global lock and once without, I am opting to defer the initialization to
the one outside of the lock.  This allows us to avoid serializing the
overhead for memory init and we can instead focus on per-node init times.

One issue I encountered is that devm_memremap_pages and
hmm_devmmem_pages_create were initializing only the pgmap field the same
way.  One wasn't initializing hmm_data, and the other was initializing it
to a poison value.  Since this is something that is exposed to the driver
in the case of hmm I am opting for a third option and just initializing
hmm_data to 0 since this is going to be exposed to unknown third party
drivers.

[[email protected]: fix reference count for pgmap in devm_memremap_pages]
Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Alexander Duyck <[email protected]>
Reviewed-by: Pavel Tatashin <[email protected]>
Tested-by: Dan Williams <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Michal Hocko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/mm.h
kernel/memremap.c
mm/hmm.c
mm/page_alloc.c
This page took 0.047796 seconds and 4 git commands to generate.