Re: [RFC] mm: fix a BUG, the page is allocated 2 times

2015-10-12 Thread yalin wang
> On Oct 12, 2015, at 21:52, Mel Gorman wrote: > > There is a redundant check and a memory leak introduced by a patch in > mmotm. This patch removes an unlikely(order) check as we are sure order > is not zero at the time. It also checks if a page is already allocated > to avoid a memory leak. >

Re: [RFC] mm: fix a BUG, the page is allocated 2 times

2015-10-12 Thread Mel Gorman
On Mon, Oct 12, 2015 at 10:40:06AM +0800, yalin wang wrote: > Remove unlikely(order), because we are sure order is not zero if > code reach here, also add if (page == NULL), only allocate page again if > __rmqueue_smallest() failed or alloc_flags & ALLOC_HARDER == 0 > > Signed-off-by: yalin wang

Re: [RFC] mm: fix a BUG, the page is allocated 2 times

2015-10-12 Thread Vlastimil Babka
On 10/12/2015 12:05 PM, Kirill A. Shutemov wrote: On Mon, Oct 12, 2015 at 03:58:51PM +0800, yalin wang wrote: On Oct 12, 2015, at 15:38, Vlastimil Babka wrote: On 10/12/2015 04:40 AM, yalin wang wrote: Remove unlikely(order), because we are sure order is not zero if code reach here, also ad

Re: [RFC] mm: fix a BUG, the page is allocated 2 times

2015-10-12 Thread Kirill A. Shutemov
On Mon, Oct 12, 2015 at 03:58:51PM +0800, yalin wang wrote: > > > On Oct 12, 2015, at 15:38, Vlastimil Babka wrote: > > > > On 10/12/2015 04:40 AM, yalin wang wrote: > >> Remove unlikely(order), because we are sure order is not zero if > >> code reach here, also add if (page == NULL), only alloc

Re: [RFC] mm: fix a BUG, the page is allocated 2 times

2015-10-12 Thread yalin wang
> On Oct 12, 2015, at 15:38, Vlastimil Babka wrote: > > On 10/12/2015 04:40 AM, yalin wang wrote: >> Remove unlikely(order), because we are sure order is not zero if >> code reach here, also add if (page == NULL), only allocate page again if >> __rmqueue_smallest() failed or alloc_flags & ALLOC_

Re: [RFC] mm: fix a BUG, the page is allocated 2 times

2015-10-12 Thread Vlastimil Babka
On 10/12/2015 04:40 AM, yalin wang wrote: Remove unlikely(order), because we are sure order is not zero if code reach here, also add if (page == NULL), only allocate page again if __rmqueue_smallest() failed or alloc_flags & ALLOC_HARDER == 0 The second mentioned change is actually more importa

[RFC] mm: fix a BUG, the page is allocated 2 times

2015-10-11 Thread yalin wang
Remove unlikely(order), because we are sure order is not zero if code reach here, also add if (page == NULL), only allocate page again if __rmqueue_smallest() failed or alloc_flags & ALLOC_HARDER == 0 Signed-off-by: yalin wang --- mm/page_alloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 de