Skip to content

RFC ftrace/rcu: Handle unsafe RCU functions and ftrace callbacks

Steven Rostedt lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest18 patches 55 repliesIn review
  2. v1 RFC8 patches 1 replySuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18ftrace: Add hash list to save RCU unsafe functionsinclude/asm-generic/vmlinux.lds.h include/linux/ftrace.h kernel/trace/ftrace.c+174 -915 replies
2/18ftrace: Do not set ftrace records for unsafe RCU when not allowedkernel/trace/ftrace.c+17 -21 reply
3/18ftrace: Set ftrace internal function tracing RCU safekernel/trace/ftrace.c+3 -14 replies
4/18ftrace: Add test for ops against unsafe RCU functions in callbackkernel/trace/ftrace.c+3 -11 reply
5/18ftrace: Do not display non safe RCU functions in available_filter_functionsinclude/linux/ftrace.h kernel/trace/ftrace.c+6 -15 replies
6/18ftrace: Add rcu_unsafe_filter_functions fileinclude/linux/ftrace.h kernel/trace/ftrace.c+32 -01 reply
7/18ftrace: Add selftest to check if RCU unsafe functions are filtered properlykernel/trace/trace.h kernel/trace/trace_selftest.c kernel/trace/trace_selftest_dynamic.c+103 -01 reply
8/18ftrace/rcu: Do not trace debug_lockdep_rcu_enabled()kernel/rcupdate.c+1 -12 replies
9/18ftrace: Fix a slight race in modifying what function callback gets tracedkernel/trace/ftrace.c+16 -10 replies
10/18ftrace: Create a RCU unsafe checkerkernel/trace/Kconfig kernel/trace/ftrace.c kernel/trace/trace.h +1 more+83 -11 reply
11/18ftrace: Adde infrastructure to stop RCU unsafe checker from checkingkernel/trace/trace.h kernel/trace/trace_functions.c+24 -34 replies
12/18ftrace: Disable RCU unsafe checker when function graph is enabledkernel/trace/ftrace.c+7 -03 replies
13/18ftrace: Disable the RCU unsafe checker when irqsoff is enabledkernel/trace/trace_irqsoff.c+14 -21 reply
14/18ftrace/lockdep: Have the RCU lockdep splat show what function triggeredinclude/linux/ftrace.h kernel/lockdep.c kernel/trace/trace_functions.c+22 -07 replies
15/18ftrace/rcu: Mark functions that are RCU unsafekernel/rcutiny.c kernel/rcutree.c+8 -03 replies
16/18rcu/irq/x86: Mark functions that are RCU unsafearch/x86/kernel/apic/apic.c arch/x86/kernel/irq.c arch/x86/kernel/irq_work.c +2 more+16 -01 reply
17/18ftrace/cpuidle/x86: Mark functions that are RCU unsafearch/x86/kernel/process.c drivers/cpuidle/cpuidle.c kernel/cpu/idle.c+6 -03 replies
18/18ftrace/sched: Mark functions that are RCU unsafekernel/sched/core.c+2 -01 reply

Reviews trailers per patch

15 of 18 patches have a Reviewed-by or Acked-by.

PatchRafael J. WysockiPaul E. McKenneyH. Peter Anvin
1/18A-b R-b
2/18A-b
3/18A-b A-b
4/18A-b
5/18A-b
6/18A-b
7/18A-b
8/18R-b
9/18
10/18A-b
11/18A-b
12/18
13/18
14/18A-b
15/18R-b
16/18A-b
17/18A-b A-b A-b
18/18A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [RFC][PATCH 00/18 v2] ftrace/rcu: Handle unsafe RCU functions and ftrace callbacks

This is my final draft of the patches. I'm starting to run them through my formal tests now. They may change depending on the outcome of the tests.

I'm also a bit tired, and I added the change logs last. Thus I may need to go back and fix the change logs up too. But the code was done when I was rather spunky. But that doesn't mean I didn't break anything.

Anyway, let me know what you think. I'm going to need acks for the places I added the FTRACE_UNSAFE_RCU() annotations.

I added a checker that traces all functions with the non RCU safe settings, and did a rcu_read_lock() with PROVE_RCU enabled. This caught several functions that needed to be annotated. There may be more, but the test gives us a way to find out.

There's some improvements that can be done to these patches, but for 3.12, I think this version is good enough. We can do the improvements for 3.13.

Well, enjoy.

-- Steve

Steven Rostedt (Red Hat) (18):
ftrace: Add hash list to save RCU unsafe functions
ftrace: Do not set ftrace records for unsafe RCU when not allowed
ftrace: Set ftrace internal function tracing RCU safe
ftrace: Add test for ops against unsafe RCU functions in callback
ftrace: Do not display non safe RCU functions in available_filter_functions
ftrace: Add rcu_unsafe_filter_functions file
ftrace: Add selftest to check if RCU unsafe functions are filtered properly ftrace/rcu: Do not trace debug_lockdep_rcu_enabled()
ftrace: Fix a slight race in modifying what function callback gets traced
ftrace: Create a RCU unsafe checker
ftrace: Adde infrastructure to stop RCU unsafe checker from checking
ftrace: Disable RCU unsafe checker when function graph is enabled
ftrace: Disable the RCU unsafe checker when irqsoff is enabled ftrace/lockdep: Have the RCU lockdep splat show what function triggered ftrace/rcu: Mark functions that are RCU unsafe
rcu/irq/x86: Mark functions that are RCU unsafe ftrace/cpuidle/x86: Mark functions that are RCU unsafe ftrace/sched: Mark functions that are RCU unsafe

----

 arch/x86/kernel/apic/apic.c           |    2 +
 arch/x86/kernel/irq.c                 |    1 +
 arch/x86/kernel/irq_work.c            |    3 +
 arch/x86/kernel/process.c             |    2 +
 arch/x86/kernel/smp.c                 |    8 ++
 drivers/cpuidle/cpuidle.c             |    2 +
 include/asm-generic/vmlinux.lds.h     |   10 ++
 include/linux/ftrace.h                |   46 +++++++
 kernel/cpu/idle.c                     |    2 +
 kernel/lockdep.c                      |    2 +
 kernel/rcupdate.c                     |    2 +-
 kernel/rcutiny.c                      |    1 +
 kernel/rcutree.c                      |    7 +
 kernel/sched/core.c                   |    2 +
 kernel/softirq.c                      |    2 +
 kernel/trace/Kconfig                  |   22 ++++
 kernel/trace/ftrace.c                 |  231 +++++++++++++++++++++++++++++++--
 kernel/trace/trace.h                  |   11 ++
 kernel/trace/trace_functions.c        |   76 ++++++++++-
 kernel/trace/trace_irqsoff.c          |   16 ++-
 kernel/trace/trace_selftest.c         |   94 ++++++++++++++
 kernel/trace/trace_selftest_dynamic.c |    7 +
 22 files changed, 532 insertions(+), 17 deletions(-)