On Mon 16-07-18 09:26:41, Pavel Tatashin wrote: > > Maybe a stupid question, but I do not see it from the code (this init > > code is just to complex to keep it cached in head so I always have to > > study the code again and again, sigh). So what exactly prevents > > memmap_init_zone to stumble over reserved regions? We do play some ugly > > games to find a first !reserved pfn in the node but I do not really see > > anything in the init path to properly skip over reserved holes inside > > the node. > > Hi Michal, > > This is not a stupid question. I figured out how this whole thing > became broken: Revert "mm: page_alloc: skip over regions of invalid > pfns where possible" caused that. > > Because, before that was reverted, memmap_init_zone() would use > memblock.memory to check that only pages that have physical backing > are initialized. But, now after that was reverted zer_resv_unavail() > scheme became totally broken. > > The concept is quite easy: zero all the allocated memmap memory that > has not been initialized by memmap_init_zone(). So, I think I will > modify memmap_init_zone() to zero the skipped pfns that have memmap > backing. But, that requires more thinking. I would just go with iterating over valid (unreserved) memory ranges in memmap_init_zone. -- Michal Hocko SUSE Labs