Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

markers: remove ACCESS_ONCE

As Paul pointed out, the ACCESS_ONCE are not needed because we already have
the explicit surrounding memory barriers.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Mike Mason <mmlnx@us.ibm.com>
Cc: Dipankar Sarma <dipankar@in.ibm.com>
Cc: David Smith <dsmith@redhat.com>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Adrian Bunk <adrian.bunk@movial.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Mathieu Desnoyers and committed by
Linus Torvalds
58336114 fd3c36f8

+6 -6
+6 -6
kernel/marker.c
··· 109 109 * modules and they insure RCU read coherency. 110 110 */ 111 111 preempt_disable(); 112 - ptype = ACCESS_ONCE(mdata->ptype); 112 + ptype = mdata->ptype; 113 113 if (likely(!ptype)) { 114 114 marker_probe_func *func; 115 115 /* Must read the ptype before ptr. They are not data dependant, 116 116 * so we put an explicit smp_rmb() here. */ 117 117 smp_rmb(); 118 - func = ACCESS_ONCE(mdata->single.func); 118 + func = mdata->single.func; 119 119 /* Must read the ptr before private data. They are not data 120 120 * dependant, so we put an explicit smp_rmb() here. */ 121 121 smp_rmb(); ··· 133 133 * in the fast path, so put the explicit barrier here. 134 134 */ 135 135 smp_read_barrier_depends(); 136 - multi = ACCESS_ONCE(mdata->multi); 136 + multi = mdata->multi; 137 137 for (i = 0; multi[i].func; i++) { 138 138 va_start(args, fmt); 139 139 multi[i].func(multi[i].probe_private, call_private, fmt, ··· 161 161 char ptype; 162 162 163 163 preempt_disable(); 164 - ptype = ACCESS_ONCE(mdata->ptype); 164 + ptype = mdata->ptype; 165 165 if (likely(!ptype)) { 166 166 marker_probe_func *func; 167 167 /* Must read the ptype before ptr. They are not data dependant, 168 168 * so we put an explicit smp_rmb() here. */ 169 169 smp_rmb(); 170 - func = ACCESS_ONCE(mdata->single.func); 170 + func = mdata->single.func; 171 171 /* Must read the ptr before private data. They are not data 172 172 * dependant, so we put an explicit smp_rmb() here. */ 173 173 smp_rmb(); ··· 183 183 * in the fast path, so put the explicit barrier here. 184 184 */ 185 185 smp_read_barrier_depends(); 186 - multi = ACCESS_ONCE(mdata->multi); 186 + multi = mdata->multi; 187 187 for (i = 0; multi[i].func; i++) 188 188 multi[i].func(multi[i].probe_private, call_private, fmt, 189 189 &args);