Skip to contentSkip to conversation

fixups for memcg cgroup_lock conversion

PATCH In review Glauber Costa 3 participants 7 messages Feb 11, 2013 – Feb 13, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover fixups for memcg cgroup_lock conversion

Andrew,

Please consider applying the following fixups to two of the patches in my latest cgroup_lock conversion series. Apparently, there were some mistake while converting one of the functions, mem_cgroup_oom_control_write. Smatch found this one due in kbuild to the lock imbalance when exiting the function.

Names should be already in your fixup format.

Glauber Costa (2):
memcg: fast hierarchy-aware child test fix
memcg: replace cgroup_lock with memcg specific memcg_lock fix

 mm/memcontrol.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Signature · 7 lines
1.8.1.2

--
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>
#1 lore raw

PATCH 1/2 memcg: fast hierarchy-aware child test fix

---
 mm/memcontrol.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
mm/memcontrol.c +1 -2
index 25ac5f4..28252c9 100644
@@ -5883,8 +5883,7 @@ static int mem_cgroup_oom_control_write(struct cgroup *cgrp,
 
 	mutex_lock(&memcg_create_mutex);
 	/* oom-kill-disable is a flag for subhierarchy. */
-	if ((parent->use_hierarchy) ||
-	    (memcg->use_hierarchy && !list_empty(&cgrp->children))) {
+	if ((parent->use_hierarchy) || memcg_has_children(memcg)) {
 		cgroup_unlock();
 		return -EINVAL;
 	}
Signature · 7 lines
1.8.1.2

--
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>
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] memcg: fast hierarchy-aware child test fix

Quoted 26 lines · Glauber Costa
---
 mm/memcontrol.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
mm/memcontrol.c +1 -2
index 25ac5f4..28252c9 100644
@@ -5883,8 +5883,7 @@ static int mem_cgroup_oom_control_write(struct cgroup *cgrp,
 
 	mutex_lock(&memcg_create_mutex);
 	/* oom-kill-disable is a flag for subhierarchy. */
-	if ((parent->use_hierarchy) ||
-	    (memcg->use_hierarchy && !list_empty(&cgrp->children))) {
+	if ((parent->use_hierarchy) || memcg_has_children(memcg)) {
 		cgroup_unlock();
 		return -EINVAL;
 	}
Signature · 7 lines
1.8.1.2

--
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>
Signature · 8 lines
Michal Hocko
SUSE Labs

--
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>
Acked-by on v1 1/2
#3 lore raw

Re: [PATCH 1/2] memcg: fast hierarchy-aware child test fix

In reply to Glauber Costa
Quoted 10 lines · Glauber Costa
---
  mm/memcontrol.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
mm/memcontrol.c +0 -0
index 25ac5f4..28252c9 100644

mm/memcontrol.c static int mem_cgroup_oom_control_write(struct cgroup *cgrp, · line 5889

Quoted 9 lines
mm/memcontrol.c +1 -2
@@ -5883,8 +5883,7 @@ static int mem_cgroup_oom_control_write(struct cgroup *cgrp,
 
  	mutex_lock(&memcg_create_mutex);
  	/* oom-kill-disable is a flag for subhierarchy. */
-	if ((parent->use_hierarchy) ||
-	    (memcg->use_hierarchy && !list_empty(&cgrp->children))) {
+	if ((parent->use_hierarchy) || memcg_has_children(memcg)) {
  		cgroup_unlock();
  		return -EINVAL;
  	}
#4 lore raw

PATCH 2/2 memcg: replace cgroup_lock with memcg specific memcg_lock fix

In reply to Glauber Costa
---
 mm/memcontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memcontrol.c +1 -1
index 28252c9..03ebf68 100644
@@ -5884,7 +5884,7 @@ static int mem_cgroup_oom_control_write(struct cgroup *cgrp,
 	mutex_lock(&memcg_create_mutex);
 	/* oom-kill-disable is a flag for subhierarchy. */
 	if ((parent->use_hierarchy) || memcg_has_children(memcg)) {
-		cgroup_unlock();
+		mutex_unlock(&memcg_create_mutex);
 		return -EINVAL;
 	}
 	memcg->oom_kill_disable = val;
Signature · 7 lines
1.8.1.2

--
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>
Acked-by on v1 2/2
#5 lore raw

Re: [PATCH 2/2] memcg: replace cgroup_lock with memcg specific memcg_lock fix

Ouch, I have totally missed this one.

Quoted 26 lines · Glauber Costa
---
 mm/memcontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memcontrol.c +1 -1
index 28252c9..03ebf68 100644
@@ -5884,7 +5884,7 @@ static int mem_cgroup_oom_control_write(struct cgroup *cgrp,
 	mutex_lock(&memcg_create_mutex);
 	/* oom-kill-disable is a flag for subhierarchy. */
 	if ((parent->use_hierarchy) || memcg_has_children(memcg)) {
-		cgroup_unlock();
+		mutex_unlock(&memcg_create_mutex);
 		return -EINVAL;
 	}
 	memcg->oom_kill_disable = val;
Signature · 6 lines
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Michal Hocko
SUSE Labs
Acked-by on v1 2/2
#6 lore raw

Re: [PATCH 2/2] memcg: replace cgroup_lock with memcg specific memcg_lock fix

In reply to Glauber Costa
Quoted 2 lines · Glauber Costa

I'm sorry I missed this...

Quoted 18 lines
---
  mm/memcontrol.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
mm/memcontrol.c +1 -1
index 28252c9..03ebf68 100644
@@ -5884,7 +5884,7 @@ static int mem_cgroup_oom_control_write(struct cgroup *cgrp,
  	mutex_lock(&memcg_create_mutex);
  	/* oom-kill-disable is a flag for subhierarchy. */
  	if ((parent->use_hierarchy) || memcg_has_children(memcg)) {
-		cgroup_unlock();
+		mutex_unlock(&memcg_create_mutex);
  		return -EINVAL;
  	}
  	memcg->oom_kill_disable = val;