summaryrefslogtreecommitdiff
path: root/include/linux/rcu_sync.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2016-08-11 18:54:13 +0200
committerOmprakash Dhyade <odhyade@codeaurora.org>2016-08-29 14:18:07 -0700
commit00eaad05be92719444d3c0107d7db6ce1d7edce1 (patch)
tree138056b2481ed2613a00382c424bb9a686e42b96 /include/linux/rcu_sync.h
parent9fe73e0c81d41127fa0c6596a375b890e35c2829 (diff)
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 1ed1328792ff 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: 0c3240a1ef2e840aaa17f593326e3642bc857aa7 Git-repo: https://android.googlesource.com/kernel/common/+/android-4.4 Signed-off-by: Omprakash Dhyade <odhyade@codeaurora.org>
Diffstat (limited to 'include/linux/rcu_sync.h')
-rw-r--r--include/linux/rcu_sync.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/rcu_sync.h b/include/linux/rcu_sync.h
index a63a33e6196e..ece7ed9a4a70 100644
--- a/include/linux/rcu_sync.h
+++ b/include/linux/rcu_sync.h
@@ -59,6 +59,7 @@ static inline bool rcu_sync_is_idle(struct rcu_sync *rsp)
}
extern void rcu_sync_init(struct rcu_sync *, enum rcu_sync_type);
+extern void rcu_sync_enter_start(struct rcu_sync *);
extern void rcu_sync_enter(struct rcu_sync *);
extern void rcu_sync_exit(struct rcu_sync *);
extern void rcu_sync_dtor(struct rcu_sync *);