aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorLai Jiangshan <[email protected]>2009-01-07 18:07:39 -0800
committerLinus Torvalds <[email protected]>2009-01-08 08:31:02 -0800
commit77efecd9e0526327548152df715ab8644ecb5ba0 (patch)
tree4dd2a82fe5db454fb018e434e07c3e6f30dc9832 /tools/perf/scripts/python
parent104cbd55377029e70fc2cee01089e84b9c36e5dc (diff)
cgroups: call find_css_set() safely in cgroup_attach_task()
In cgroup_attach_task(), tsk maybe exit when we call find_css_set(). and find_css_set() will access to invalid css_set. This patch increases the count before get_css_set(), and decreases it after find_css_set(). NOTE: css_set's refcount is also taskcount, after this patch applied, taskcount may be off-by-one WHEN cgroup_lock() is not held. but I reviewed other code which use taskcount, they are still correct. No regression found by reviewing and simply testing. So I do not use two counters in css_set. (one counter for taskcount, the other for refcount. like struct mm_struct) If this fix cause regression, we will use two counters in css_set. Signed-off-by: Lai Jiangshan <[email protected]> Cc: Paul Menage <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Cc: Pavel Emelyanov <[email protected]> Cc: Balbir Singh <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions