kernel_optimize_test/kernel
Lai Jiangshan 77efecd9e0 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 <laijs@cn.fujitsu.com>
Cc: Paul Menage <menage@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Cc: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:02 -08:00
..
irq async: Asynchronous function calls to speed up kernel boot 2009-01-07 08:45:46 -08:00
power pm: struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-06 10:44:39 -08:00
time Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-01-07 11:31:52 -08:00
trace
.gitignore
acct.c
async.c async: don't do the initcall stuff post boot 2009-01-07 09:31:49 -08:00
audit_tree.c audit: validate comparison operations, store them in sane form 2009-01-04 15:14:42 -05:00
audit.c
audit.h fixing audit rule ordering mess, part 1 2009-01-04 15:14:41 -05:00
auditfilter.c audit: validate comparison operations, store them in sane form 2009-01-04 15:14:42 -05:00
auditsc.c make sure that filterkey of task,always rules is reported 2009-01-04 15:14:42 -05:00
backtracetest.c
bounds.c
capability.c Merge branch 'next' into for-linus 2009-01-07 09:58:22 +11:00
cgroup_debug.c
cgroup_freezer.c
cgroup.c cgroups: call find_css_set() safely in cgroup_attach_task() 2009-01-08 08:31:02 -08:00
compat.c Allow times and time system calls to return small negative values 2009-01-06 15:59:13 -08:00
configs.c
cpu.c stop_machine/cpu hotplug: fix disable_nonboot_cpus 2009-01-07 11:36:14 -08:00
cpuset.c oom: print triggering task's cpuset and mems allowed 2009-01-06 15:58:59 -08:00
cred-internals.h
cred.c
delayacct.c
dma-coherent.c dma-coherent: catch oversized requests to dma_alloc_from_coherent() 2009-01-06 15:59:31 -08:00
dma.c
exec_domain.c
exit.c mm: introduce get_mm_hiwater_xxx(), fix taskstats->hiwater_xxx accounting 2009-01-06 15:59:09 -08:00
extable.c
fork.c coredump_filter: permit changing of the default filter 2009-01-06 15:59:29 -08:00
freezer.c
futex_compat.c
futex.c Merge branches 'core/futexes', 'core/locking', 'core/rcu' and 'linus' into core/urgent 2009-01-06 09:32:11 +01:00
hrtimer.c hrtimer: splitout peek ahead functionality, fix 2009-01-05 14:11:10 +01:00
itimer.c
kallsyms.c
Kconfig.freezer
Kconfig.hz
Kconfig.preempt
kexec.c
kfifo.c
kgdb.c
kmod.c kmod: fix varargs kernel-doc 2009-01-06 15:59:27 -08:00
kprobes.c kprobes: support probing module __init function 2009-01-06 15:59:21 -08:00
ksysfs.c kernel/ksysfs.c:fix dependence on CONFIG_NET 2009-01-06 10:44:31 -08:00
kthread.c
latencytop.c
lockdep_internals.h
lockdep_proc.c
lockdep.c
Makefile async: Asynchronous function calls to speed up kernel boot 2009-01-07 08:45:46 -08:00
marker.c
module.c async: Asynchronous function calls to speed up kernel boot 2009-01-07 08:45:46 -08:00
mutex-debug.c
mutex-debug.h
mutex.c
mutex.h
notifier.c
ns_cgroup.c ns_cgroup: remove unused spinlock 2009-01-08 08:31:02 -08:00
nsproxy.c
panic.c oops: increment the oops UUID every time we oops 2009-01-06 15:59:12 -08:00
params.c
pid_namespace.c
pid.c trivial: fix then -> than typos in comments and documentation 2009-01-06 11:28:06 +01:00
pm_qos_params.c
posix-cpu-timers.c
posix-timers.c
printk.c trivial: printk: fix indentation of new_text_line declaration 2009-01-06 11:28:06 +01:00
profile.c profile: don't include <asm/ptrace.h> twice. 2009-01-06 15:59:14 -08:00
ptrace.c
rcuclassic.c
rcupdate.c rcu: eliminate synchronize_rcu_xxx macro 2009-01-05 10:18:08 +01:00
rcupreempt_trace.c
rcupreempt.c rcu: eliminate synchronize_rcu_xxx macro 2009-01-05 10:18:08 +01:00
rcutorture.c rcu: fix rcutorture bug 2009-01-05 13:09:49 +01:00
rcutree_trace.c
rcutree.c rcu: make treercu safe for suspend and resume 2009-01-05 10:12:33 +01:00
relay.c
res_counter.c
resource.c resource: allow MMIO exclusivity for device drivers 2009-01-07 11:12:32 -08:00
rtmutex_common.h
rtmutex-debug.c
rtmutex-debug.h
rtmutex-tester.c
rtmutex.c
rtmutex.h
rwsem.c
sched_clock.c
sched_cpupri.c sched: fix section mismatch 2009-01-06 11:07:15 +01:00
sched_cpupri.h
sched_debug.c
sched_fair.c Merge branch 'linus' into sched/urgent 2009-01-05 13:53:39 +01:00
sched_features.h
sched_idletask.c
sched_rt.c sched: put back some stack hog changes that were undone in kernel/sched.c 2009-01-03 19:00:09 +01:00
sched_stats.h
sched.c sched: fix possible recursive rq->lock 2009-01-07 16:10:54 +01:00
seccomp.c
semaphore.c
signal.c SEND_SIG_NOINFO: set si_pid to tgid instead of pid 2009-01-06 15:59:29 -08:00
smp.c
softirq.c Merge branch 'cpus4096-for-linus-3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-01-03 12:04:39 -08:00
softlockup.c
spinlock.c
srcu.c
stacktrace.c
stop_machine.c stop_machine: introduce stop_machine_create/destroy. 2009-01-05 08:40:14 +10:30
sys_ni.c
sys.c Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-01-06 17:10:33 -08:00
sysctl_check.c
sysctl.c mm: add dirty_background_bytes and dirty_bytes sysctls 2009-01-06 15:59:03 -08:00
taskstats.c
test_kprobes.c kprobes: add tests for register_kprobes 2009-01-06 15:59:20 -08:00
time.c Allow times and time system calls to return small negative values 2009-01-06 15:59:13 -08:00
timeconst.pl
timer.c
tracepoint.c
tsacct.c mm: introduce get_mm_hiwater_xxx(), fix taskstats->hiwater_xxx accounting 2009-01-06 15:59:09 -08:00
uid16.c
user_namespace.c
user.c
utsname_sysctl.c
utsname.c
wait.c
workqueue.c