Re: [PATCH 3/3] mm: move mirrored memory specific code outside of memmap_init_zone

From: Oscar Salvador
Date: Wed Jul 25 2018 - 07:48:53 EST


On Tue, Jul 24, 2018 at 07:55:20PM -0400, Pavel Tatashin wrote:
> memmap_init_zone, is getting complex, because it is called from different
> contexts: hotplug, and during boot, and also because it must handle some
> architecture quirks. One of them is mirroed memory.
>
> Move the code that decides whether to skip mirrored memory outside of
> memmap_init_zone, into a separate function.
>
> Signed-off-by: Pavel Tatashin <pasha.tatashin@xxxxxxxxxx>

Hi Pavel,

this looks good to me.
Over the past days I thought if it would make sense to have two
memmap_init_zone functions, one for hotplug and another one for early init,
so we could get rid of the altmap stuff in the early init, and also the
MEMMAP_EARLY/HOTPLUG context thing could be gone.

But I think that they would just share too much of the code, so I do not think
it is worth.

I am working to do that for free_area_init_core, let us see what I come up with.

Anyway, this looks nicer, so thanks for that.
I also gave it a try, and early init and memhotplug code seems to work fine.

Reviewed-by: Oscar Salvador <osalvador@xxxxxxx>

Thanks
--
Oscar Salvador
SUSE L3