summaryrefslogtreecommitdiff
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-10-05 19:29:14 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-10-05 19:29:13 -0700
commit3ff37b4bacd0ffddadce5d701dfc2e1310649042 (patch)
tree71800600ad221429d40c21a1c61f0ebdfea33305 /kernel/cgroup.c
parent057bdafd976ca7609ed223dbd4473d535bcb6459 (diff)
parent35f2961082327e970a35a14e72269072e3403b27 (diff)
Merge "RFC: FROMLIST: cgroup: reduce read locked section of cgroup_threadgroup_rwsem during fork"
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index ad4a12371069..cc6c7d0a6758 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -5376,6 +5376,12 @@ int __init cgroup_init(void)
BUG_ON(cgroup_init_cftypes(NULL, cgroup_dfl_base_files));
BUG_ON(cgroup_init_cftypes(NULL, cgroup_legacy_base_files));
+ /*
+ * The latency of the synchronize_sched() is too high for cgroups,
+ * avoid it at the cost of forcing all readers into the slow path.
+ */
+ rcu_sync_enter_start(&cgroup_threadgroup_rwsem.rss);
+
mutex_lock(&cgroup_mutex);
/* Add init_css_set to the hash table */