From: Mathieu Desnoyers - Add comments requested by Andrew. Signed-off-by: Mathieu Desnoyers Signed-off-by: Andrew Morton --- kernel/marker.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff -puN kernel/marker.c~linux-kernel-markers-support-multiple-probes-update kernel/marker.c --- a/kernel/marker.c~linux-kernel-markers-support-multiple-probes-update +++ a/kernel/marker.c @@ -49,6 +49,7 @@ static DEFINE_MUTEX(markers_mutex); * between two consecutive operation (add or remove) on a given marker. It is * also used to delay the free of multiple probes array until a quiescent state * is reached. + * marker entries modifications are protected by the markers_mutex. */ struct marker_entry { struct hlist_node hlist; @@ -102,6 +103,11 @@ void marker_probe_cb(const struct marker va_list args; char ptype; + /* + * disabling preemption to make sure the teardown of the callbacks can + * be done correctly when they are in modules and they insure RCU read + * coherency. + */ preempt_disable(); ptype = ACCESS_ONCE(mdata->ptype); if (likely(!ptype)) { @@ -196,7 +202,7 @@ static void free_old_closure(struct rcu_ entry->rcu_pending = 0; } -static inline void debug_print_probes(struct marker_entry *entry) +static void debug_print_probes(struct marker_entry *entry) { int i; _