linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: JoonSoo Kim <js1304@gmail.com>
To: Mel Gorman <mgorman@suse.de>
Cc: David Rientjes <rientjes@google.com>,
	akpm@linux-foundation.org, Pekka Enberg <penberg@kernel.org>,
	Christoph Lameter <cl@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0
Date: Wed, 11 Jul 2012 00:24:41 +0900	[thread overview]
Message-ID: <CAAmzW4NhRipDDqyNc3zYTx3fpsOVE6Cc6kc9X-L_p0iKZu7+jA@mail.gmail.com> (raw)
In-Reply-To: <20120710104722.GB14154@suse.de>

2012/7/10 Mel Gorman <mgorman@suse.de>:
> 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 the cost of a function call.

Yes, I agree.

> If the cost is indeed high and you have seen this in profiles then I
> suggest you create a forced inline function alloc_pages_direct_compact
> that does this;
>
> if (order != 0)
>         __alloc_pages_direct_compact(...)
>
> and then call alloc_pages_direct_compact instead of
> __alloc_pages_direct_compact. After that, recheck the profiles (although I
> expect the difference to be marginal) and the size of vmlinux (if it gets
> bigger, it's probably not worth it).
> 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 suggestion looks good.
But, the size of page_alloc.o is more than before.

I test 3 approaches, vanilla, always_inline and
wrapping(alloc_page_direct_compact which is your suggestion).
In my environment (v3.5-rc5, gcc 4.6.3, x86_64), page_alloc.o shows
below number.

                                         total, .text section, .text.unlikely
page_alloc_vanilla.o:     93432,   0x510a,        0x243
page_alloc_inline.o:       93336,   0x52ca,          0xa4
page_alloc_wrapping.o: 93528,   0x515a,        0x238

Andrew said that inlining add only 26 bytes to .text of page_alloc.o,
but in my system, need more bytes.
Currently, I think this patch doesn't have obvious benefit, so I want
to drop it.
Any objections?

Thanks for good comments.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-07-10 15:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-06 15:28 Joonsoo Kim
2012-07-06 15:59 ` Minchan Kim
2012-07-06 16:58   ` JoonSoo Kim
2012-07-07  0:38     ` Minchan Kim
2012-07-08  2:29       ` JoonSoo Kim
2012-07-07  8:40 ` David Rientjes
2012-07-08  2:33   ` JoonSoo Kim
2012-07-08 22:53     ` David Rientjes
2012-07-09 14:13       ` JoonSoo Kim
2012-07-09 21:10         ` David Rientjes
2012-07-09 22:41         ` Andrew Morton
2012-07-10 10:47     ` Mel Gorman
2012-07-10 15:24       ` JoonSoo Kim [this message]
2012-07-10 15:48         ` Mel Gorman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAmzW4NhRipDDqyNc3zYTx3fpsOVE6Cc6kc9X-L_p0iKZu7+jA@mail.gmail.com \
    --to=js1304@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox