Re: [v6 05/15] mm: don't accessed uninitialized struct pages

2017-08-17 Thread Michal Hocko
On Thu 17-08-17 11:28:23, Pasha Tatashin wrote: > Hi Michal, > > I've been looking through this code again, and I think your suggestion will > work. I did not realize this iterator already exist: > > for_each_free_mem_range() basically iterates through (memory && !reserved) > > This is exactly

Re: [v6 05/15] mm: don't accessed uninitialized struct pages

2017-08-17 Thread Pasha Tatashin
Hi Michal, I've been looking through this code again, and I think your suggestion will work. I did not realize this iterator already exist: for_each_free_mem_range() basically iterates through (memory && !reserved) This is exactly what we need here. So, I will update this patch to use this

Re: [v6 05/15] mm: don't accessed uninitialized struct pages

2017-08-15 Thread Michal Hocko
[CC Mel - the original patch was http://lkml.kernel.org/r/1502138329-123460-6-git-send-email-pasha.tatas...@oracle.com] On Mon 07-08-17 16:38:39, Pavel Tatashin wrote: > In deferred_init_memmap() where all deferred struct pages are initialized > we have a check like this: > > if

Re: [v6 05/15] mm: don't accessed uninitialized struct pages

2017-08-14 Thread Pasha Tatashin
mem_init() free_all_bootmem() free_low_memory_core_early() for_each_reserved_mem_region() reserve_bootmem_region() init_reserved_page() <- if this is deferred reserved page __init_single_pfn() __init_single_page() So, currently, we are using the value of

Re: [v6 05/15] mm: don't accessed uninitialized struct pages

2017-08-14 Thread Michal Hocko
On Fri 11-08-17 11:55:39, Pasha Tatashin wrote: > On 08/11/2017 05:37 AM, Michal Hocko wrote: > >On Mon 07-08-17 16:38:39, Pavel Tatashin wrote: > >>In deferred_init_memmap() where all deferred struct pages are initialized > >>we have a check like this: > >> > >> if (page->flags) { > >>

Re: [v6 05/15] mm: don't accessed uninitialized struct pages

2017-08-11 Thread Pasha Tatashin
On 08/11/2017 05:37 AM, Michal Hocko wrote: On Mon 07-08-17 16:38:39, Pavel Tatashin wrote: In deferred_init_memmap() where all deferred struct pages are initialized we have a check like this: if (page->flags) { VM_BUG_ON(page_zone(page) != zone); goto

Re: [v6 05/15] mm: don't accessed uninitialized struct pages

2017-08-11 Thread Michal Hocko
On Mon 07-08-17 16:38:39, Pavel Tatashin wrote: > In deferred_init_memmap() where all deferred struct pages are initialized > we have a check like this: > > if (page->flags) { > VM_BUG_ON(page_zone(page) != zone); > goto free_range; > } > > This way we are

[v6 05/15] mm: don't accessed uninitialized struct pages

2017-08-07 Thread Pavel Tatashin
In deferred_init_memmap() where all deferred struct pages are initialized we have a check like this: if (page->flags) { VM_BUG_ON(page_zone(page) != zone); goto free_range; } This way we are checking if the current deferred page has already been initialized. It