Commit 17a1a10
committed
tracing: Replace syscall RCU pointer assignment with READ/WRITE_ONCE()
The syscall events are pseudo events that hook to the raw syscalls. The
ftrace_syscall_enter/exit() callback is called by the raw_syscall
enter/exit tracepoints respectively whenever any of the syscall events are
enabled.
The trace_array has an array of syscall "files" that correspond to the
system calls based on their __NR_SYSCALL number. The array is read and if
there's a pointer to a trace_event_file then it is considered enabled and
if it is NULL that syscall event is considered disabled.
Currently it uses an rcu_dereference_sched() to get this pointer and a
rcu_assign_ptr() or RCU_INIT_POINTER() to write to it. This is unnecessary
as the file pointer will not go away outside the synchronization of the
tracepoint logic itself. And this code adds no extra RCU synchronization
that uses this.
Replace these functions with a simple READ_ONCE() and WRITE_ONCE() which
is all they need. This will also allow this code to not depend on
preemption being disabled as system call tracepoints are now allowed to
fault.
Cc: Masami Hiramatsu <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Takaya Saeki <[email protected]>
Cc: Tom Zanussi <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Douglas Raillard <[email protected]>
Link: https://lore.kernel.org/[email protected]
Reviewed-by: Paul E. McKenney <[email protected]>
Signed-off-by: Steven Rostedt (Google) <[email protected]>1 parent 76eeb9b commit 17a1a10
2 files changed
+8
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
384 | | - | |
| 383 | + | |
| 384 | + | |
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
314 | | - | |
| 313 | + | |
315 | 314 | | |
316 | 315 | | |
317 | 316 | | |
| |||
356 | 355 | | |
357 | 356 | | |
358 | 357 | | |
359 | | - | |
360 | | - | |
| 358 | + | |
361 | 359 | | |
362 | 360 | | |
363 | 361 | | |
| |||
393 | 391 | | |
394 | 392 | | |
395 | 393 | | |
396 | | - | |
| 394 | + | |
397 | 395 | | |
398 | 396 | | |
399 | 397 | | |
| |||
411 | 409 | | |
412 | 410 | | |
413 | 411 | | |
414 | | - | |
| 412 | + | |
415 | 413 | | |
416 | 414 | | |
417 | 415 | | |
| |||
431 | 429 | | |
432 | 430 | | |
433 | 431 | | |
434 | | - | |
| 432 | + | |
435 | 433 | | |
436 | 434 | | |
437 | 435 | | |
| |||
449 | 447 | | |
450 | 448 | | |
451 | 449 | | |
452 | | - | |
| 450 | + | |
453 | 451 | | |
454 | 452 | | |
455 | 453 | | |
| |||
0 commit comments