From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Kautuk Consul <consul.kautuk@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Hugh Dickins <hughd@google.com>, Mel Gorman <mgorman@suse.de>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2 v2] rmap: Make page_referenced_file and page_referenced_anon inline
Date: Mon, 20 Feb 2012 12:03:46 +0900 [thread overview]
Message-ID: <20120220120346.9cc5b7b6.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <1329492398-7631-1-git-send-email-consul.kautuk@gmail.com>
On Fri, 17 Feb 2012 10:26:38 -0500
Kautuk Consul <consul.kautuk@gmail.com> wrote:
> Inline the page_referenced_anon and page_referenced_file
> functions.
> These functions are called only from page_referenced.
>
> Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
Hmm ? In my environ,
before patch.
[kamezawa@bluextal linux]$ size mm/rmap.o
text data bss dec hex filename
11474 0 24 11498 2cea mm/rmap.o
(8833) (optimize-for-size=y)
After patch.
[kamezawa@bluextal linux]$ size mm/rmap.o
text data bss dec hex filename
11422 0 24 11446 2cb6 mm/rmap.o
(8775) (optimize-for-size=y)
text size is 50bytes decreased. But I wonder page_referenced_anon/file
is enough large function which is not inlined by hand in usual...
>From Documentation/CodingStyle Chapter15: The inline disease
==
A reasonable rule of thumb is to not put inline at functions that have more
than 3 lines of code in them. An exception to this rule are the cases where
a parameter is known to be a compiletime constant, and as a result of this
constantness you *know* the compiler will be able to optimize most of your
function away at compile time. For a good example of this later case, see
the kmalloc() inline function.
Often people argue that adding inline to functions that are static and used
only once is always a win since there is no space tradeoff. While this is
technically correct, gcc is capable of inlining these automatically without
help, and the maintenance issue of removing the inline when a second user
appears outweighs the potential value of the hint that tells gcc to do
something it would have done anyway.
==
I'm sorry but I don't Ack this.
Thanks,
-Kame
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2012-02-20 3:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-17 15:26 Kautuk Consul
2012-02-20 3:03 ` KAMEZAWA Hiroyuki [this message]
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=20120220120346.9cc5b7b6.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=consul.kautuk@gmail.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
/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