Skip to contentSkip to conversation

debug cgroup: remove unneeded cgroup_lock

PATCH In review Li Zefan 4 participants 5 messages Mar 12, 2009 2 messages not in the archive

lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 1/1 debug cgroup: remove unneeded cgroup_lock

Since we are in cgroup write handler, so the cgrp is valid, so we don't have to hold cgroup_mutex when calling cgroup_task_count(). One similar example is in cgroup_tasks_open().

---
 kernel/cgroup_debug.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
kernel/cgroup_debug.c +0 -2
index daca620..0c92d79 100644
@@ -40,9 +40,7 @@ static u64 taskcount_read(struct cgroup *cont, struct cftype *cft)
 {
 	u64 count;
 
-	cgroup_lock();
 	count = cgroup_task_count(cont);
-	cgroup_unlock();
 	return count;
 }
 
Signature · 1 line
1.5.4.rc3

A message that is not in the archive (sent off-list or not yet received): [email protected]

Acked-by
#2 lore raw
Quoted 5 lines · Li Zefan

Since we are in cgroup write handler, so the cgrp is valid, so we don't have to hold cgroup_mutex when calling cgroup_task_count(). One similar example is in cgroup_tasks_open().

(Although this conflicts with a patch that I'm about to send out that moves the code from cgroup_debug.c into cgroup.c to allow internal details to be reported in the debug.* files.)

Quoted 22 lines
---
 kernel/cgroup_debug.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
kernel/cgroup_debug.c +0 -3
index daca620..0c92d79 100644
@@ -40,9 +40,7 @@ static u64 taskcount_read(struct cgroup *cont, struct cftype *cft)
 {
       u64 count;
 
-       cgroup_lock();
       count = cgroup_task_count(cont);
-       cgroup_unlock();
       return count;
 }
 
--

1.5.4.rc3

Acked-by on v1 1/1
#3 lore raw
In reply to Li Zefan
Quoted 5 lines · Li Zefan

Since we are in cgroup write handler, so the cgrp is valid, so we don't have to hold cgroup_mutex when calling cgroup_task_count(). One similar example is in cgroup_tasks_open().

(Although this conflicts with a patch that I'm about to send out that moves the code from cgroup_debug.c into cgroup.c to allow internal details to be reported in the debug.* files.)

Quoted 22 lines
---
 kernel/cgroup_debug.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
kernel/cgroup_debug.c +0 -3
index daca620..0c92d79 100644
@@ -40,9 +40,7 @@ static u64 taskcount_read(struct cgroup *cont, struct cftype *cft)
 {
       u64 count;
 
-       cgroup_lock();
       count = cgroup_task_count(cont);
-       cgroup_unlock();
       return count;
 }
 
--

1.5.4.rc3

A message that is not in the archive (sent off-list or not yet received): 6599ad830903111943u2799333dh680470f9daa6ccbb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#5 lore raw
Quoted 5 lines · Paul Menage
Quoted 4 lines · Li Zefan

Since we are in cgroup write handler, so the cgrp is valid, so we don't have to hold cgroup_mutex when calling cgroup_task_count(). One similar example is in cgroup_tasks_open().

Quoted 8 lines
Quoted 1 line

(Although this conflicts with a patch that I'm about to send out that moves the code from cgroup_debug.c into cgroup.c to allow internal details to be reported in the debug.* files.)

or let cgroup.c #include <cgroup_debug.c> ?

author
#6 lore raw
In reply to Paul Menage
Quoted 5 lines · Paul Menage
Quoted 4 lines · Li Zefan

Since we are in cgroup write handler, so the cgrp is valid, so we don't have to hold cgroup_mutex when calling cgroup_task_count(). One similar example is in cgroup_tasks_open().

Quoted 8 lines
Quoted 1 line

(Although this conflicts with a patch that I'm about to send out that moves the code from cgroup_debug.c into cgroup.c to allow internal details to be reported in the debug.* files.)

or let cgroup.c #include <cgroup_debug.c> ?