android_kernel_oneplus_msm8998/kernel/rcu
Peter Zijlstra 00eaad05be RFC: FROMLIST: cgroup: avoid synchronize_sched() in __cgroup_procs_write()
The current percpu-rwsem read side is entirely free of serializing insns
at the cost of having a synchronize_sched() in the write path.

The latency of the synchronize_sched() is too high for cgroups. The
commit 1ed1328792 talks about the write path being a fairly cold path
but this is not the case for Android which moves task to the foreground
cgroup and back around binder IPC calls from foreground processes to
background processes, so it is significantly hotter than human initiated
operations.

Switch cgroup_threadgroup_rwsem into the slow mode for now to avoid the
problem, hopefully it should not be that slow after another commit
80127a39681b ("locking/percpu-rwsem: Optimize readers and reduce global
impact").

We could just add rcu_sync_enter() into cgroup_init() but we do not want
another synchronize_sched() at boot time, so this patch adds the new helper
which doesn't block but currently can only be called before the first use.

Cc: Tejun Heo <tj@kernel.org>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Reported-by: John Stultz <john.stultz@linaro.org>
Reported-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
[jstultz: backported to 4.4]
Change-Id: I34aa9c394d3052779b56976693e96d861bd255f2
Mailing-list-URL: https://lkml.org/lkml/2016/8/11/557
Signed-off-by: John Stultz <john.stultz@linaro.org>
Git-commit: 0c3240a1ef
Git-repo: https://android.googlesource.com/kernel/common/+/android-4.4
Signed-off-by: Omprakash Dhyade <odhyade@codeaurora.org>
2016-08-29 14:18:07 -07:00
..
Makefile rcu: Create rcu_sync infrastructure 2015-10-06 11:25:04 -07:00
rcu.h tiny_rcu: Directly force QS when call_rcu_[bh|sched]() on idle_task 2015-01-06 11:01:12 -08:00
rcutorture.c Merge branches 'doc.2015.10.06a', 'percpu-rwsem.2015.10.06a' and 'torture.2015.10.06a' into HEAD 2015-10-07 16:06:25 -07:00
srcu.c rcu: Move preemption disabling out of __srcu_read_lock() 2015-10-06 11:15:43 -07:00
sync.c RFC: FROMLIST: cgroup: avoid synchronize_sched() in __cgroup_procs_write() 2016-08-29 14:18:07 -07:00
tiny.c rcu: Use rcu_callback_t in call_rcu*() and friends 2015-10-06 11:08:05 -07:00
tiny_plugin.h rcu: Convert ACCESS_ONCE() to READ_ONCE() and WRITE_ONCE() 2015-05-27 12:56:15 -07:00
tree.c Merge branches 'fixes.2015.10.06a' and 'exp.2015.10.07a' into HEAD 2015-10-07 16:05:21 -07:00
tree.h Merge branches 'fixes.2015.10.06a' and 'exp.2015.10.07a' into HEAD 2015-10-07 16:05:21 -07:00
tree_plugin.h Merge branches 'fixes.2015.10.06a' and 'exp.2015.10.07a' into HEAD 2015-10-07 16:05:21 -07:00
tree_trace.c Merge branches 'fixes.2015.10.06a' and 'exp.2015.10.07a' into HEAD 2015-10-07 16:05:21 -07:00
update.c rcu: Use rcu_callback_t in call_rcu*() and friends 2015-10-06 11:08:05 -07:00