]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.trace/rcu-read-sched.patch
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.trace / rcu-read-sched.patch
CommitLineData
2cb7cef9
BS
1From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
2Subject: RCU read sched
3
4Add rcu_read_lock_sched() and rcu_read_unlock_sched() to rcupdate.h to match the
5recently added write-side call_rcu_sched() and rcu_barrier_sched(). They also
6match the no-so-recently-added synchronize_sched().
7
8It will help following matching use of the update/read lock primitives. Those
9new read lock will replace preempt_disable()/enable() used in pair with
10RCU-classic synchronization.
11
12Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
13Acked-by: Peter Zijlstra <peterz@infradead.org>
14CC: Paul E McKenney <paulmck@linux.vnet.ibm.com>
15CC: akpm@linux-foundation.org
16Acked-by: Jan Blunck <jblunck@suse.de>
17---
18 include/linux/rcupdate.h | 20 ++++++++++++++++++++
19 1 file changed, 20 insertions(+)
20
21--- a/include/linux/rcupdate.h
22+++ b/include/linux/rcupdate.h
23@@ -133,6 +133,26 @@ struct rcu_head {
24 #define rcu_read_unlock_bh() __rcu_read_unlock_bh()
25
26 /**
27+ * rcu_read_lock_sched - mark the beginning of a RCU-classic critical section
28+ *
29+ * Should be used with either
30+ * - synchronize_sched()
31+ * or
32+ * - call_rcu_sched() and rcu_barrier_sched()
33+ * on the write-side to insure proper synchronization.
34+ */
35+#define rcu_read_lock_sched() preempt_disable()
36+
37+/*
38+ * rcu_read_unlock_sched - marks the end of a RCU-classic critical section
39+ *
40+ * See rcu_read_lock_sched for more information.
41+ */
42+#define rcu_read_unlock_sched() preempt_enable()
43+
44+
45+
46+/**
47 * rcu_dereference - fetch an RCU-protected pointer in an
48 * RCU read-side critical section. This pointer may later
49 * be safely dereferenced.