diff options
author | Tejun Heo <tj@kernel.org> | 2015-05-13 16:35:17 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2015-05-26 20:35:00 -0400 |
commit | d59cfc09c32a2ae31f1c3bc2983a0cd79afb3f14 (patch) | |
tree | 077533cef8f5e16c8f7fd65d7e255d75828f3820 /include/linux/init_task.h | |
parent | 7d7efec368d537226142cbe559f45797f18672f9 (diff) | |
download | linux-stable-d59cfc09c32a2ae31f1c3bc2983a0cd79afb3f14.tar.gz linux-stable-d59cfc09c32a2ae31f1c3bc2983a0cd79afb3f14.tar.bz2 linux-stable-d59cfc09c32a2ae31f1c3bc2983a0cd79afb3f14.zip |
sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem
The cgroup side of threadgroup locking uses signal_struct->group_rwsem
to synchronize against threadgroup changes. This per-process rwsem
adds small overhead to thread creation, exit and exec paths, forces
cgroup code paths to do lock-verify-unlock-retry dance in a couple
places and makes it impossible to atomically perform operations across
multiple processes.
This patch replaces signal_struct->group_rwsem with a global
percpu_rwsem cgroup_threadgroup_rwsem which is cheaper on the reader
side and contained in cgroups proper. This patch converts one-to-one.
This does make writer side heavier and lower the granularity; however,
cgroup process migration is a fairly cold path, we do want to optimize
thread operations over it and cgroup migration operations don't take
enough time for the lower granularity to matter.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'include/linux/init_task.h')
-rw-r--r-- | include/linux/init_task.h | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 696d22312b31..0cc0bbf20022 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -25,13 +25,6 @@ extern struct files_struct init_files; extern struct fs_struct init_fs; -#ifdef CONFIG_CGROUPS -#define INIT_GROUP_RWSEM(sig) \ - .group_rwsem = __RWSEM_INITIALIZER(sig.group_rwsem), -#else -#define INIT_GROUP_RWSEM(sig) -#endif - #ifdef CONFIG_CPUSETS #define INIT_CPUSET_SEQ(tsk) \ .mems_allowed_seq = SEQCNT_ZERO(tsk.mems_allowed_seq), @@ -56,7 +49,6 @@ extern struct fs_struct init_fs; }, \ .cred_guard_mutex = \ __MUTEX_INITIALIZER(sig.cred_guard_mutex), \ - INIT_GROUP_RWSEM(sig) \ } extern struct nsproxy init_nsproxy; |