projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
42aee6c
)
memcg: let css_get_next() rely upon rcu_read_lock()
author
Hugh Dickins
<
[email protected]
>
Wed, 21 Mar 2012 23:34:21 +0000
(16:34 -0700)
committer
Linus Torvalds
<
[email protected]
>
Thu, 22 Mar 2012 00:55:01 +0000
(17:55 -0700)
Remove lock and unlock around css_get_next()'s call to idr_get_next().
memcg iterators (only users of css_get_next) already did rcu_read_lock(),
and its comment demands that; but add a WARN_ON_ONCE to make sure of it.
Signed-off-by: Hugh Dickins <
[email protected]
>
Acked-by: KAMEZAWA Hiroyuki <
[email protected]
>
Acked-by: Li Zefan <
[email protected]
>
Cc: Eric Dumazet <
[email protected]
>
Acked-by: Tejun Heo <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
kernel/cgroup.c
patch
|
blob
|
history
diff --git
a/kernel/cgroup.c
b/kernel/cgroup.c
index 8eb90f25bd7b13341acf66bb6a0c8d796e3b064c..391d5e991e5f539c99a081799957f63f0b39124f 100644
(file)
--- a/
kernel/cgroup.c
+++ b/
kernel/cgroup.c
@@
-5033,6
+5033,8
@@
css_get_next(struct cgroup_subsys *ss, int id,
return NULL;
BUG_ON(!ss->use_id);
+ WARN_ON_ONCE(!rcu_read_lock_held());
+
/* fill start point for scan */
tmpid = id;
while (1) {
@@
-5040,10
+5042,7
@@
css_get_next(struct cgroup_subsys *ss, int id,
* scan next entry from bitmap(tree), tmpid is updated after
* idr_get_next().
*/
- spin_lock(&ss->id_lock);
tmp = idr_get_next(&ss->idr, &tmpid);
- spin_unlock(&ss->id_lock);
-
if (!tmp)
break;
if (tmp->depth >= depth && tmp->stack[depth] == rootid) {