[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20120220120346.9cc5b7b6.kamezawa.hiroyu@jp.fujitsu.com>
Date: Mon, 20 Feb 2012 12:03:46 +0900
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To: Kautuk Consul <consul.kautuk@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Hugh Dickins <hughd@...gle.com>, Mel Gorman <mgorman@...e.de>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2 v2] rmap: Make page_referenced_file and
page_referenced_anon inline
On Fri, 17 Feb 2012 10:26:38 -0500
Kautuk Consul <consul.kautuk@...il.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@...il.com>
Hmm ? In my environ,
before patch.
[kamezawa@...extal 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@...extal 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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists