Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130392
b: refs/heads/master
c: 804b3c2
h: refs/heads/master
v: v3
  • Loading branch information
Paul Menage authored and Linus Torvalds committed Jan 30, 2009
1 parent 32d32cd commit 49a1a55
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1404f06565ee89e0ce04d4a5859c00b0e3a0dc8d
refs/heads/master: 804b3c28a4e4fa1c224571bf76edb534b9c4b1ed
1 change: 1 addition & 0 deletions trunk/include/linux/cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ static inline bool css_tryget(struct cgroup_subsys_state *css)
while (!atomic_inc_not_zero(&css->refcnt)) {
if (test_bit(CSS_REMOVED, &css->flags))
return false;
cpu_relax();
}
return true;
}
Expand Down
7 changes: 5 additions & 2 deletions trunk/kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -2509,7 +2509,7 @@ static int cgroup_clear_css_refs(struct cgroup *cgrp)
for_each_subsys(cgrp->root, ss) {
struct cgroup_subsys_state *css = cgrp->subsys[ss->subsys_id];
int refcnt;
do {
while (1) {
/* We can only remove a CSS with a refcnt==1 */
refcnt = atomic_read(&css->refcnt);
if (refcnt > 1) {
Expand All @@ -2523,7 +2523,10 @@ static int cgroup_clear_css_refs(struct cgroup *cgrp)
* css_tryget() to spin until we set the
* CSS_REMOVED bits or abort
*/
} while (atomic_cmpxchg(&css->refcnt, refcnt, 0) != refcnt);
if (atomic_cmpxchg(&css->refcnt, refcnt, 0) == refcnt)
break;
cpu_relax();
}
}
done:
for_each_subsys(cgrp->root, ss) {
Expand Down

0 comments on commit 49a1a55

Please sign in to comment.