rmap: Staticize page_referenced_file and page_referenced_anon
Subsystems (2)
PATCH 1/2 rmap: Staticize page_referenced_file and page_referenced_anon
Staticize the page_referenced_anon and page_referenced_file functions.
These functions are called only from page_referenced.
--- mm/rmap.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
mm/rmap.c +2 -2
@@ -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) {
Signature · 8 lines
1.7.5.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. 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:"[email protected]"> [email protected] </a>
Quoted 3 lines · Kautuk Consul
Staticize the
page_referenced_anonandpage_referenced_filefunctions.
These functions are called only frompage_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?
mm/rmap.c out: · line 775
Quoted 2 lines
mm/rmap.c +1
-1-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 [email protected]. 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:"[email protected]"> [email protected] </a>
Quoted 7 lines · Peter Zijlstra
Quoted 3 lines · Kautuk Consul
Staticize the
page_referenced_anonandpage_referenced_filefunctions.
These functions are called only frompage_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. :)
Quoted 3 lines
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.
Quoted 5 lines
mm/rmap.c out: · line 775
Quoted 3 lines
mm/rmap.c +1
-1-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 [email protected]. 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:"[email protected]"> [email protected] </a>
Okay, I sent v2 of this anyway with the correct description.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. 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:"[email protected]"> [email protected] </a>
Quoted 6 lines · Kautuk Consul
Quoted 2 lines
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 [email protected]. 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:"[email protected]"> [email protected] </a>