aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/hugetlb_cgroup.c2
-rw-r--r--mm/memcontrol.c14
2 files changed, 8 insertions, 8 deletions
diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
index a380681ab3cf..493f758445e7 100644
--- a/mm/hugetlb_cgroup.c
+++ b/mm/hugetlb_cgroup.c
@@ -52,7 +52,7 @@ static inline bool hugetlb_cgroup_is_root(struct hugetlb_cgroup *h_cg)
52static inline struct hugetlb_cgroup * 52static inline struct hugetlb_cgroup *
53parent_hugetlb_cgroup(struct hugetlb_cgroup *h_cg) 53parent_hugetlb_cgroup(struct hugetlb_cgroup *h_cg)
54{ 54{
55 return hugetlb_cgroup_from_css(css_parent(&h_cg->css)); 55 return hugetlb_cgroup_from_css(h_cg->css.parent);
56} 56}
57 57
58static inline bool hugetlb_cgroup_have_usage(struct hugetlb_cgroup *h_cg) 58static inline bool hugetlb_cgroup_have_usage(struct hugetlb_cgroup *h_cg)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index b638a79209ee..a5e0417b4f9a 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1540,7 +1540,7 @@ static unsigned long mem_cgroup_margin(struct mem_cgroup *memcg)
1540int mem_cgroup_swappiness(struct mem_cgroup *memcg) 1540int mem_cgroup_swappiness(struct mem_cgroup *memcg)
1541{ 1541{
1542 /* root ? */ 1542 /* root ? */
1543 if (!css_parent(&memcg->css)) 1543 if (!memcg->css.parent)
1544 return vm_swappiness; 1544 return vm_swappiness;
1545 1545
1546 return memcg->swappiness; 1546 return memcg->swappiness;
@@ -4909,7 +4909,7 @@ static int mem_cgroup_hierarchy_write(struct cgroup_subsys_state *css,
4909{ 4909{
4910 int retval = 0; 4910 int retval = 0;
4911 struct mem_cgroup *memcg = mem_cgroup_from_css(css); 4911 struct mem_cgroup *memcg = mem_cgroup_from_css(css);
4912 struct mem_cgroup *parent_memcg = mem_cgroup_from_css(css_parent(&memcg->css)); 4912 struct mem_cgroup *parent_memcg = mem_cgroup_from_css(memcg->css.parent);
4913 4913
4914 mutex_lock(&memcg_create_mutex); 4914 mutex_lock(&memcg_create_mutex);
4915 4915
@@ -5207,8 +5207,8 @@ static void memcg_get_hierarchical_limit(struct mem_cgroup *memcg,
5207 if (!memcg->use_hierarchy) 5207 if (!memcg->use_hierarchy)
5208 goto out; 5208 goto out;
5209 5209
5210 while (css_parent(&memcg->css)) { 5210 while (memcg->css.parent) {
5211 memcg = mem_cgroup_from_css(css_parent(&memcg->css)); 5211 memcg = mem_cgroup_from_css(memcg->css.parent);
5212 if (!memcg->use_hierarchy) 5212 if (!memcg->use_hierarchy)
5213 break; 5213 break;
5214 tmp = res_counter_read_u64(&memcg->res, RES_LIMIT); 5214 tmp = res_counter_read_u64(&memcg->res, RES_LIMIT);
@@ -5443,7 +5443,7 @@ static int mem_cgroup_swappiness_write(struct cgroup_subsys_state *css,
5443 struct cftype *cft, u64 val) 5443 struct cftype *cft, u64 val)
5444{ 5444{
5445 struct mem_cgroup *memcg = mem_cgroup_from_css(css); 5445 struct mem_cgroup *memcg = mem_cgroup_from_css(css);
5446 struct mem_cgroup *parent = mem_cgroup_from_css(css_parent(&memcg->css)); 5446 struct mem_cgroup *parent = mem_cgroup_from_css(memcg->css.parent);
5447 5447
5448 if (val > 100 || !parent) 5448 if (val > 100 || !parent)
5449 return -EINVAL; 5449 return -EINVAL;
@@ -5790,7 +5790,7 @@ static int mem_cgroup_oom_control_write(struct cgroup_subsys_state *css,
5790 struct cftype *cft, u64 val) 5790 struct cftype *cft, u64 val)
5791{ 5791{
5792 struct mem_cgroup *memcg = mem_cgroup_from_css(css); 5792 struct mem_cgroup *memcg = mem_cgroup_from_css(css);
5793 struct mem_cgroup *parent = mem_cgroup_from_css(css_parent(&memcg->css)); 5793 struct mem_cgroup *parent = mem_cgroup_from_css(memcg->css.parent);
5794 5794
5795 /* cannot set to root cgroup and only 0 and 1 are allowed */ 5795 /* cannot set to root cgroup and only 0 and 1 are allowed */
5796 if (!parent || !((val == 0) || (val == 1))) 5796 if (!parent || !((val == 0) || (val == 1)))
@@ -6407,7 +6407,7 @@ static int
6407mem_cgroup_css_online(struct cgroup_subsys_state *css) 6407mem_cgroup_css_online(struct cgroup_subsys_state *css)
6408{ 6408{
6409 struct mem_cgroup *memcg = mem_cgroup_from_css(css); 6409 struct mem_cgroup *memcg = mem_cgroup_from_css(css);
6410 struct mem_cgroup *parent = mem_cgroup_from_css(css_parent(css)); 6410 struct mem_cgroup *parent = mem_cgroup_from_css(css->parent);
6411 6411
6412 if (css->id > MEM_CGROUP_ID_MAX) 6412 if (css->id > MEM_CGROUP_ID_MAX)
6413 return -ENOSPC; 6413 return -ENOSPC;