diff options
| author | Tejun Heo <tj@kernel.org> | 2015-09-16 12:53:17 -0400 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2015-09-16 12:53:17 -0400 |
| commit | 1ed1328792ff46e4bb86a3d7f7be2971f4549f6c (patch) | |
| tree | 53719cfc0bf81bc7e6fb522944553d9b4fa36cbf /include/linux/init_task.h | |
| parent | 0c986253b939cc14c69d4adbe2b4121bdf4aa220 (diff) | |
sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem
Note: This commit was originally committed as d59cfc09c32a but got
reverted by 0c986253b939 due to the performance regression from
the percpu_rwsem write down/up operations added to cgroup task
migration path. percpu_rwsem changes which alleviate the
performance issue are pending for v4.4-rc1 merge window.
Re-apply.
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>
Link: http://lkml.kernel.org/g/55F8097A.7000206@de.ibm.com
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 e38681f4912d..d0b380ee7d67 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
| @@ -25,13 +25,6 @@ | |||
| 25 | extern struct files_struct init_files; | 25 | extern struct files_struct init_files; |
| 26 | extern struct fs_struct init_fs; | 26 | extern struct fs_struct init_fs; |
| 27 | 27 | ||
| 28 | #ifdef CONFIG_CGROUPS | ||
| 29 | #define INIT_GROUP_RWSEM(sig) \ | ||
| 30 | .group_rwsem = __RWSEM_INITIALIZER(sig.group_rwsem), | ||
| 31 | #else | ||
| 32 | #define INIT_GROUP_RWSEM(sig) | ||
| 33 | #endif | ||
| 34 | |||
| 35 | #ifdef CONFIG_CPUSETS | 28 | #ifdef CONFIG_CPUSETS |
| 36 | #define INIT_CPUSET_SEQ(tsk) \ | 29 | #define INIT_CPUSET_SEQ(tsk) \ |
| 37 | .mems_allowed_seq = SEQCNT_ZERO(tsk.mems_allowed_seq), | 30 | .mems_allowed_seq = SEQCNT_ZERO(tsk.mems_allowed_seq), |
| @@ -64,7 +57,6 @@ extern struct fs_struct init_fs; | |||
| 64 | INIT_PREV_CPUTIME(sig) \ | 57 | INIT_PREV_CPUTIME(sig) \ |
| 65 | .cred_guard_mutex = \ | 58 | .cred_guard_mutex = \ |
| 66 | __MUTEX_INITIALIZER(sig.cred_guard_mutex), \ | 59 | __MUTEX_INITIALIZER(sig.cred_guard_mutex), \ |
| 67 | INIT_GROUP_RWSEM(sig) \ | ||
| 68 | } | 60 | } |
| 69 | 61 | ||
| 70 | extern struct nsproxy init_nsproxy; | 62 | extern struct nsproxy init_nsproxy; |
