From ab82f74f6c72b02244f61bb85f66565fb89aac27 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 29 Nov 2012 14:16:37 +1100 Subject: [PATCH] memcg: replace __always_inline with plain inline Following the pattern found in the allocators, where we do our best to the fast paths function-call free, all the externally visible functions for kmemcg were marked __always_inline. It is fair to say, however, that this should be up to the compiler. We will still keep as much of the flag testing as we can in memcontrol.h to give the compiler the option to inline it, but won't force it. I tested this with 4.7.2, it will inline all three functions anyway when compiling with -O2, and will refrain from it when compiling with -Os. This seems like a good behavior. Signed-off-by: Glauber Costa Cc: Michal Hocko Acked-by: KAMEZAWA Hiroyuki Cc: Johannes Weiner Acked-by: David Rientjes Signed-off-by: Andrew Morton --- include/linux/memcontrol.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index e6ca1cfc5030..2d8e170c53a3 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -444,7 +444,7 @@ void __memcg_kmem_uncharge_pages(struct page *page, int order); * We return true automatically if this allocation is not to be accounted to * any memcg. */ -static __always_inline bool +static inline bool memcg_kmem_newpage_charge(gfp_t gfp, struct mem_cgroup **memcg, int order) { if (!memcg_kmem_enabled()) @@ -476,7 +476,7 @@ memcg_kmem_newpage_charge(gfp_t gfp, struct mem_cgroup **memcg, int order) * * there is no need to specify memcg here, since it is embedded in page_cgroup */ -static __always_inline void +static inline void memcg_kmem_uncharge_pages(struct page *page, int order) { if (memcg_kmem_enabled()) @@ -494,7 +494,7 @@ memcg_kmem_uncharge_pages(struct page *page, int order) * charges. Otherwise, it will commit the memcg given by @memcg to the * corresponding page_cgroup. */ -static __always_inline void +static inline void memcg_kmem_commit_charge(struct page *page, struct mem_cgroup *memcg, int order) { if (memcg_kmem_enabled() && memcg) -- 2.39.5