Re: [RFC] mm: Fix memory corruption caused by deferred page initialization

2016-04-04 Thread Gavin Shan
On Mon, Apr 04, 2016 at 09:39:39AM +0100, Mel Gorman wrote: >On Thu, Mar 31, 2016 at 01:27:34PM +1100, Gavin Shan wrote: >> >So the issue is only existing when CONFIG_NO_BOOTMEM=n. The alternative fix >> >would >> >be similar to what we have on !CONFIG_NO_BOOTMEM: In early stage, all page >>

Re: [RFC] mm: Fix memory corruption caused by deferred page initialization

2016-04-04 Thread Mel Gorman
On Thu, Mar 31, 2016 at 01:27:34PM +1100, Gavin Shan wrote: > >So the issue is only existing when CONFIG_NO_BOOTMEM=n. The alternative fix > >would > >be similar to what we have on !CONFIG_NO_BOOTMEM: In early stage, all page > >structs > >for bootmem reserved pages are initialized and mark them

Re: [RFC] mm: Fix memory corruption caused by deferred page initialization

2016-03-30 Thread Gavin Shan
On Mon, Mar 28, 2016 at 12:48:27AM +1100, Gavin Shan wrote: >On Sun, Mar 27, 2016 at 12:37:09AM +1100, Gavin Shan wrote: >>On Sat, Mar 26, 2016 at 08:47:17PM +1100, Michael Ellerman wrote: >>>Hi Gavin, >>> >>>On Fri, 2016-25-03 at 16:05:29 UTC, Gavin Shan wrote: During deferred page

Re: [RFC] mm: Fix memory corruption caused by deferred page initialization

2016-03-28 Thread Li Zhang
A problem is found by back porting page parallel initialisation for RHEL7.2. And CONFIG_NO_BOOTMEM = n. If kernel old version with page parallel needs to work well, it still needs to fix with BOOTMEM as this patch looks like. There are some potential bugs with page parallel in RHEL7.2. I will

Re: [RFC] mm: Fix memory corruption caused by deferred page initialization

2016-03-28 Thread Gavin Shan
On Sun, Mar 27, 2016 at 12:37:09AM +1100, Gavin Shan wrote: >On Sat, Mar 26, 2016 at 08:47:17PM +1100, Michael Ellerman wrote: >>Hi Gavin, >> >>On Fri, 2016-25-03 at 16:05:29 UTC, Gavin Shan wrote: >>> During deferred page initialization, the pages are moved from memblock >>> or bootmem to buddy

Re: [RFC] mm: Fix memory corruption caused by deferred page initialization

2016-03-28 Thread Aneesh Kumar K.V
Gavin Shan writes: > [ text/plain ] > On Sat, Mar 26, 2016 at 08:47:17PM +1100, Michael Ellerman wrote: >>Hi Gavin, >> >>On Fri, 2016-25-03 at 16:05:29 UTC, Gavin Shan wrote: >>> During deferred page initialization, the pages are moved from memblock >>> or bootmem to

Re: [RFC] mm: Fix memory corruption caused by deferred page initialization

2016-03-26 Thread Gavin Shan
On Sat, Mar 26, 2016 at 08:47:17PM +1100, Michael Ellerman wrote: >Hi Gavin, > >On Fri, 2016-25-03 at 16:05:29 UTC, Gavin Shan wrote: >> During deferred page initialization, the pages are moved from memblock >> or bootmem to buddy allocator without checking they were reserved. Those >> reserved

Re: [RFC] mm: Fix memory corruption caused by deferred page initialization

2016-03-26 Thread Michael Ellerman
Hi Gavin, On Fri, 2016-25-03 at 16:05:29 UTC, Gavin Shan wrote: > During deferred page initialization, the pages are moved from memblock > or bootmem to buddy allocator without checking they were reserved. Those > reserved pages can be reallocated to somebody else by buddy/slab allocator. > It

[PATCH RFC] mm: Fix memory corruption caused by deferred page initialization

2016-03-25 Thread Gavin Shan
During deferred page initialization, the pages are moved from memblock or bootmem to buddy allocator without checking they were reserved. Those reserved pages can be reallocated to somebody else by buddy/slab allocator. It leads to memory corruption and potential kernel crash eventually. This