Re: [PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-10 Thread Mel Gorman
On Wed, Jul 11, 2012 at 12:24:41AM +0900, JoonSoo Kim wrote: > > That would be functionally similar to your patch but it will preserve git > > blame, churn less code and be harder to make mistakes with in the unlikely > > event a third call to alloc_pages_direct_compact is ever added. > > Your sug

Re: [PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-10 Thread JoonSoo Kim
2012/7/10 Mel Gorman : > You say that invoking the function is very costly. I agree that a function > call with that many parameters is hefty but it is also in the slow path of > the allocator. For order-0 allocations we are about to enter direct reclaim > where I would expect the cost far exceeds

Re: [PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-10 Thread Mel Gorman
On Sun, Jul 08, 2012 at 11:33:14AM +0900, JoonSoo Kim wrote: > 2012/7/7 David Rientjes : > > On Sat, 7 Jul 2012, Joonsoo Kim wrote: > > > >> __alloc_pages_direct_compact has many arguments so invoking it is very > >> costly. > >> And in almost invoking case, order is 0, so return immediately. > >>

Re: [PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-09 Thread Andrew Morton
On Mon, 9 Jul 2012 23:13:50 +0900 JoonSoo Kim wrote: > >> In my kernel image, __alloc_pages_direct_compact() is not inlined by gcc. My gcc-4.4.4 doesn't inline it either. > I think __alloc_pages_direct_compact() can't be inlined by gcc, > because it is so big and is invoked two times in __alloc

Re: [PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-09 Thread David Rientjes
On Mon, 9 Jul 2012, JoonSoo Kim wrote: > I think __alloc_pages_direct_compact() can't be inlined by gcc, > because it is so big and is invoked two times in __alloc_pages_nodemask(). > We could fix that by doing diff --git a/mm/page_alloc.c b/mm/page_alloc.c --- a/mm/page_alloc.c +++ b/mm/page_a

Re: [PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-09 Thread JoonSoo Kim
2012/7/9 David Rientjes : > On Sun, 8 Jul 2012, JoonSoo Kim wrote: > >> >> __alloc_pages_direct_compact has many arguments so invoking it is very >> >> costly. >> >> And in almost invoking case, order is 0, so return immediately. >> >> >> > >> > If "zero cost" is "very costly", then this might mak

Re: [PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-08 Thread David Rientjes
On Sun, 8 Jul 2012, JoonSoo Kim wrote: > >> __alloc_pages_direct_compact has many arguments so invoking it is very > >> costly. > >> And in almost invoking case, order is 0, so return immediately. > >> > > > > If "zero cost" is "very costly", then this might make sense. > > > > __alloc_pages_dire

Re: [PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-07 Thread JoonSoo Kim
2012/7/7 David Rientjes : > On Sat, 7 Jul 2012, Joonsoo Kim wrote: > >> __alloc_pages_direct_compact has many arguments so invoking it is very >> costly. >> And in almost invoking case, order is 0, so return immediately. >> > > If "zero cost" is "very costly", then this might make sense. > > __all

Re: [PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-07 Thread JoonSoo Kim
>> >> >> And in almost invoking case, order is 0, so return immediately. >> > >> > You can't make sure it. >> >> Okay. >> >> >> >> >> Let's not invoke it when order 0 >> > >> > Let's not ruin git blame. >> >> Hmm... >> When I do git blame, I can't find anything related to this. > > I mean if we mer

Re: [PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-07 Thread David Rientjes
On Sat, 7 Jul 2012, Joonsoo Kim wrote: > __alloc_pages_direct_compact has many arguments so invoking it is very costly. > And in almost invoking case, order is 0, so return immediately. > If "zero cost" is "very costly", then this might make sense. __alloc_pages_direct_compact() is inlined by g

Re: [PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-06 Thread Minchan Kim
On Sat, Jul 07, 2012 at 01:58:24AM +0900, JoonSoo Kim wrote: > 2012/7/7 Minchan Kim : > > Hi Joonsoo, > > > > On Sat, Jul 07, 2012 at 12:28:41AM +0900, Joonsoo Kim wrote: > >> __alloc_pages_direct_compact has many arguments so invoking it is very > >> costly. > > > > It's already slow path so it's

Re: [PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-06 Thread JoonSoo Kim
2012/7/7 Minchan Kim : > Hi Joonsoo, > > On Sat, Jul 07, 2012 at 12:28:41AM +0900, Joonsoo Kim wrote: >> __alloc_pages_direct_compact has many arguments so invoking it is very >> costly. > > It's already slow path so it's pointless for such optimization. I know this is so minor optimization. But

Re: [PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-06 Thread Minchan Kim
Hi Joonsoo, On Sat, Jul 07, 2012 at 12:28:41AM +0900, Joonsoo Kim wrote: > __alloc_pages_direct_compact has many arguments so invoking it is very costly. It's already slow path so it's pointless for such optimization. > And in almost invoking case, order is 0, so return immediately. You can't m

[PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-06 Thread Joonsoo Kim
__alloc_pages_direct_compact has many arguments so invoking it is very costly. And in almost invoking case, order is 0, so return immediately. Let's not invoke it when order 0 Signed-off-by: Joonsoo Kim diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 6092f33..f4039aa 100644 --- a/mm/page_a