X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=kernel%2Fcgroup.c;h=de1c1bddb4d1f8ad98ff071b3f001e6839e8ed2f;hb=7cf0f1426a909ed36a8b349a4a975e0d68b5edad;hp=d1c51b7f5221fbfbb85ed3d12e4918a970713829;hpb=e8285cec4e6d6500d1ac25ec81ced56deffdb1fb;p=cascardo%2Flinux.git diff --git a/kernel/cgroup.c b/kernel/cgroup.c index d1c51b7f5221..de1c1bddb4d1 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -5606,6 +5606,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); + get_user_ns(init_cgroup_ns.user_ns); mutex_lock(&cgroup_mutex); @@ -6270,6 +6276,12 @@ void cgroup_sk_alloc(struct sock_cgroup_data *skcd) if (cgroup_sk_alloc_disabled) return; + /* Socket clone path */ + if (skcd->val) { + cgroup_get(sock_cgroup_ptr(skcd)); + return; + } + rcu_read_lock(); while (true) {