linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] rmap: Staticize page_referenced_file and page_referenced_anon
@ 2012-02-17 14:27 Kautuk Consul
  2012-02-17 15:15 ` Peter Zijlstra
  0 siblings, 1 reply; 5+ messages in thread
From: Kautuk Consul @ 2012-02-17 14:27 UTC (permalink / raw)
  To: Andrew Morton, Peter Zijlstra, Hugh Dickins, KAMEZAWA Hiroyuki,
	Mel Gorman
  Cc: linux-mm, linux-kernel, Kautuk Consul

Staticize 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>
---
 mm/rmap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index c8454e0..74aff97 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -772,7 +772,7 @@ out:
 	return referenced;
 }
 
-static int page_referenced_anon(struct page *page,
+static inline int page_referenced_anon(struct page *page,
 				struct mem_cgroup *memcg,
 				unsigned long *vm_flags)
 {
@@ -821,7 +821,7 @@ static int page_referenced_anon(struct page *page,
  *
  * This function is only called from page_referenced for object-based pages.
  */
-static int page_referenced_file(struct page *page,
+static inline int page_referenced_file(struct page *page,
 				struct mem_cgroup *memcg,
 				unsigned long *vm_flags)
 {
-- 
1.7.5.4

--
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>

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] rmap: Staticize page_referenced_file and page_referenced_anon
  2012-02-17 14:27 [PATCH 1/2] rmap: Staticize page_referenced_file and page_referenced_anon Kautuk Consul
@ 2012-02-17 15:15 ` Peter Zijlstra
  2012-02-17 15:19   ` Kautuk Consul
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Zijlstra @ 2012-02-17 15:15 UTC (permalink / raw)
  To: Kautuk Consul
  Cc: Andrew Morton, Hugh Dickins, KAMEZAWA Hiroyuki, Mel Gorman,
	linux-mm, linux-kernel

On Fri, 2012-02-17 at 09:27 -0500, Kautuk Consul wrote:
> Staticize the page_referenced_anon and page_referenced_file
> functions.
> These functions are called only from page_referenced.

Subject and changelog say: staticize, which I read to mean: make static.
Yet what the patch does is make them inline ?!?

Also, if they're static and there's only a single callsite, gcc will
already inline them, does this patch really make a difference?

> -static int page_referenced_anon(struct page *page,
> +static inline int page_referenced_anon(struct page *page,


--
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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] rmap: Staticize page_referenced_file and page_referenced_anon
  2012-02-17 15:15 ` Peter Zijlstra
@ 2012-02-17 15:19   ` Kautuk Consul
  2012-02-17 15:27     ` Kautuk Consul
  2012-02-17 18:07     ` Peter Zijlstra
  0 siblings, 2 replies; 5+ messages in thread
From: Kautuk Consul @ 2012-02-17 15:19 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Andrew Morton, Hugh Dickins, KAMEZAWA Hiroyuki, Mel Gorman,
	linux-mm, linux-kernel

On Fri, Feb 17, 2012 at 10:15 AM, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> On Fri, 2012-02-17 at 09:27 -0500, Kautuk Consul wrote:
>> Staticize the page_referenced_anon and page_referenced_file
>> functions.
>> These functions are called only from page_referenced.
>
> Subject and changelog say: staticize, which I read to mean: make static.
> Yet what the patch does is make them inline ?!?

Yes, sorry my mistake. :)

>
> Also, if they're static and there's only a single callsite, gcc will
> already inline them, does this patch really make a difference?

I just sent this patch for what I thought was "correctness", but I guess
we can let this be if you are absolutely sure that all GCC cross compilers
for all platforms will guarantee inlining.



>
>> -static int page_referenced_anon(struct page *page,
>> +static inline int page_referenced_anon(struct page *page,
>
>


Please reply back if you feel I should resend this patch with modified
description.
Else, I'll just forget about this one. :)

--
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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] rmap: Staticize page_referenced_file and page_referenced_anon
  2012-02-17 15:19   ` Kautuk Consul
@ 2012-02-17 15:27     ` Kautuk Consul
  2012-02-17 18:07     ` Peter Zijlstra
  1 sibling, 0 replies; 5+ messages in thread
From: Kautuk Consul @ 2012-02-17 15:27 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Andrew Morton, Hugh Dickins, KAMEZAWA Hiroyuki, Mel Gorman,
	linux-mm, linux-kernel

Okay, I sent v2 of this anyway with the correct description.

--
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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] rmap: Staticize page_referenced_file and page_referenced_anon
  2012-02-17 15:19   ` Kautuk Consul
  2012-02-17 15:27     ` Kautuk Consul
@ 2012-02-17 18:07     ` Peter Zijlstra
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Zijlstra @ 2012-02-17 18:07 UTC (permalink / raw)
  To: Kautuk Consul
  Cc: Andrew Morton, Hugh Dickins, KAMEZAWA Hiroyuki, Mel Gorman,
	linux-mm, linux-kernel

On Fri, 2012-02-17 at 10:19 -0500, Kautuk Consul wrote:
> > Also, if they're static and there's only a single callsite, gcc will
> > already inline them, does this patch really make a difference?
> 
> I just sent this patch for what I thought was "correctness", but I guess
> we can let this be if you are absolutely sure that all GCC cross compilers
> for all platforms will guarantee inlining. 

Typically we don't explicitly inline such large functions, unless we
need it for performance.

--
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>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-02-17 18:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-17 14:27 [PATCH 1/2] rmap: Staticize page_referenced_file and page_referenced_anon Kautuk Consul
2012-02-17 15:15 ` Peter Zijlstra
2012-02-17 15:19   ` Kautuk Consul
2012-02-17 15:27     ` Kautuk Consul
2012-02-17 18:07     ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).