memcg: optimize memcg_get_hierarchical_limit
Subsystems (3)
PATCH 5/6 memcg: optimize memcg_get_hierarchical_limit
From: Wanpeng Li <[email protected]>
Optimize memcg_get_hierarchical_limit to save cpu cycle.
--- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memcontrol.c +1 -1
@@ -3917,9 +3917,9 @@ static void memcg_get_hierarchical_limit(struct mem_cgroup *memcg, min_limit =res_counter_read_u64 (&memcg->res,RES_LIMIT ); min_memsw_limit =res_counter_read_u64 (&memcg->memsw,RES_LIMIT ); - cgroup = memcg->css.cgroup;if (!memcg->use_hierarchy) goto out; + cgroup = memcg->css.cgroup;while (cgroup->parent) { cgroup = cgroup->parent;
Signature · 1 line
1.7.9.5
Johannes Weiner
maintainerQuoted 5 lines · Wanpeng Li
From: Wanpeng Li <[email protected]>
Optimize
memcg_get_hierarchical_limitto save cpu cycle.Signed-off-by Wanpeng Li <[email protected]>
I really would have thought the compiler would detect it, but this patch actually does switch around move and jump.
But this is miniscule and anything but a fastpath...
Quoted 22 lines
--- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/memcontrol.c +1
-1@@ -3917,9 +3917,9 @@ static void memcg_get_hierarchical_limit(struct mem_cgroup *memcg, min_limit =res_counter_read_u64 (&memcg->res,RES_LIMIT ); min_memsw_limit =res_counter_read_u64 (&memcg->memsw,RES_LIMIT ); - cgroup = memcg->css.cgroup;if (!memcg->use_hierarchy) goto out; + cgroup = memcg->css.cgroup;while (cgroup->parent) { cgroup = cgroup->parent;Signature · 1 line
1.7.9.5
--
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/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 15 lines · Wanpeng Li
From: Wanpeng Li <[email protected]>
Optimize
memcg_get_hierarchical_limitto save cpu cycle.Signed-off-by Wanpeng Li <[email protected]>--- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/memcontrol.c +0
-0
mm/memcontrol.c static void memcg_get_hierarchical_limit(struct mem_cgroup *memcg, · line 3925
Quoted 10 lines
mm/memcontrol.c +1
-1@@ -3917,9 +3917,9 @@ static void memcg_get_hierarchical_limit(struct mem_cgroup *memcg, min_limit =res_counter_read_u64 (&memcg->res,RES_LIMIT ); min_memsw_limit =res_counter_read_u64 (&memcg->memsw,RES_LIMIT ); - cgroup = memcg->css.cgroup;if (!memcg->use_hierarchy) goto out; + cgroup = memcg->css.cgroup;while (cgroup->parent) { cgroup = cgroup->parent;
Seriously, this saves nothing.
--
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/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>