[PATCH for 2.6.25] Markers - use synchronize_sched()
- From: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxx>
- Date: Mon, 31 Mar 2008 09:16:09 -0400
Use synchronize_sched before calling call_rcu in CONFIG_PREEMPT_RCU until we
have call_rcu_sched and rcu_barrier_sched in mainline. It will slow down the
marker operations in CONFIG_PREEMPT_RCU, but it fixes the current race against
the preempt_disable/enable() protected code paths.
Paul, is this ok ? It would be good to get this in for 2.6.25 final.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxx>
CC: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
---
kernel/marker.c | 9 +++++++++
1 file changed, 9 insertions(+)
Index: linux-2.6-lttng/kernel/marker.c
===================================================================
--- linux-2.6-lttng.orig/kernel/marker.c 2008-03-31 08:22:24.000000000 -0400
+++ linux-2.6-lttng/kernel/marker.c 2008-03-31 08:43:30.000000000 -0400
@@ -671,6 +671,9 @@ int marker_probe_register(const char *na
entry->rcu_pending = 1;
/* write rcu_pending before calling the RCU callback */
smp_wmb();
+#ifdef CONFIG_PREEMPT_RCU
+ synchronize_sched(); /* Until we have the call_rcu_sched() */
+#endif
call_rcu(&entry->rcu, free_old_closure);
end:
mutex_unlock(&markers_mutex);
@@ -714,6 +717,9 @@ int marker_probe_unregister(const char *
entry->rcu_pending = 1;
/* write rcu_pending before calling the RCU callback */
smp_wmb();
+#ifdef CONFIG_PREEMPT_RCU
+ synchronize_sched(); /* Until we have the call_rcu_sched() */
+#endif
call_rcu(&entry->rcu, free_old_closure);
remove_marker(name); /* Ignore busy error message */
ret = 0;
@@ -792,6 +798,9 @@ int marker_probe_unregister_private_data
entry->rcu_pending = 1;
/* write rcu_pending before calling the RCU callback */
smp_wmb();
+#ifdef CONFIG_PREEMPT_RCU
+ synchronize_sched(); /* Until we have the call_rcu_sched() */
+#endif
call_rcu(&entry->rcu, free_old_closure);
remove_marker(entry->name); /* Ignore busy error message */
end:
--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Prev by Date: Re: [PATCH 0/3] xen: Fix oops when mapping/unmapping addr above 1Gb
- Next by Date: [BUILD_FAILURE] linux-next: Tree for March 31 build fails with CONFIG_SLICOSS=y
- Previous by thread: build issue for v2.6.25-rc7-187-ga9edadb in mm/slub.c
- Next by thread: [PATCH 00/40] KVM updates for the 2.6.26 merge window (part I)
- Index(es):
Relevant Pages
- Re: [PATCH 0/2] SELinux Netlabel updates
... These are updated Netlabel/SELinux changes from Paul, ... they don't break
userspace. ... #ifdef CONFIG_NETLABEL ... (Linux-Kernel) - [PATCH 3/5] Call security hooks conditionally if the security_op is filled out.
... static inline int security_ptrace (struct task_struct * parent, ... #ifdef
CONFIG_SECURITY ... (Linux-Kernel) - [PATCH 17/17] BLOCK: Make it possible to disable the block layer [try #2]
... +config BLOCK ... +#ifdef CONFIG_BLOCK ... tristate "ROM file
system support" ... (Linux-Kernel) - [PATCH 18/18] [PATCH] BLOCK: Make it possible to disable the block layer [try #3]
... +config BLOCK ... +#ifdef CONFIG_BLOCK ... tristate "ROM file
system support" ... (Linux-Kernel) - [PATCH 18/18] [PATCH] BLOCK: Make it possible to disable the block layer [try #4]
... +config BLOCK ... +#ifdef CONFIG_BLOCK ... tristate "ROM file
system support" ... (Linux-Kernel)