Skip to content

tracing vs world

Peter Zijlstra linux-arch lkml oe-kbuild-all 2 versions – Applied

Status from this message: The following commit has been merged into the locking/core branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest27 patches 55 repliesApplied
  2. v322 patches 72 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/27lockdep: Teach lockdep about "USED" <- "IN-NMI" inversionskernel/locking/lockdep.c+50 -37 replies
2/27hardirq/nmi: Allow nested nmi_enter()arch/arm64/include/asm/hardirq.h arch/arm64/kernel/sdei.c arch/arm64/kernel/traps.c +4 more+22 -4110 replies
3/27x86/entry: Flip _TIF_SIGPENDING and _TIF_NOTIFY_RESUME handlingarch/x86/entry/common.c+4 -41 reply
4/27x86/mce: Delete ist_begin_non_atomic()arch/x86/include/asm/traps.h arch/x86/kernel/cpu/mce/core.c arch/x86/kernel/traps.c +1 more+36 -622 replies
5/27x86: Replace ist_enter() with nmi_enter()arch/x86/include/asm/traps.h arch/x86/kernel/cpu/mce/core.c arch/x86/kernel/cpu/mce/p5.c +2 more+32 -6813 replies
6/27x86/doublefault: Remove memmove() callarch/x86/kernel/traps.c+6 -11 reply
7/27rcu: Make RCU IRQ enter/exit functions rely on in_nmi()kernel/rcu/tree.c+14 -311 reply
8/27rcu/kprobes: Comment why rcu_nmi_enter() is marked NOKPROBEkernel/rcu/tree.c+8 -01 reply
9/27rcu: Rename rcu_irq_{enter,exit}_irqson()include/linux/rcupdate.h include/linux/rcutiny.h include/linux/rcutree.h +4 more+16 -163 replies
10/27rcu: Mark rcu_dynticks_curr_cpu_in_eqs() inlinekernel/rcu/tree.c+1 -10 replies
11/27rcu,tracing: Create trace_rcu_{enter,exit}()include/linux/rcupdate.h+29 -02 replies
12/27sched,rcu,tracing: Avoid tracing before in_nmi() is correctinclude/linux/hardirq.h+11 -20 replies
13/27x86,tracing: Add comments to do_nmi()arch/x86/kernel/nmi.c+8 -20 replies
14/27perf,tracing: Prepare the perf-trace interface for RCU changeskernel/events/core.c+5 -00 replies
15/27tracing: Employ trace_rcu_{enter,exit}()kernel/trace/trace.c+3 -160 replies
16/27tracing: Remove regular RCU context for _rcuidle tracepoints (again)include/linux/tracepoint.h+2 -614 replies
17/27perf,tracing: Allow function tracing when !RCUkernel/trace/trace_event_perf.c+1 -10 replies
18/27x86/int3: Ensure that poke_int3_handler() is not tracedarch/x86/include/asm/ptrace.h arch/x86/include/asm/text-patching.h arch/x86/kernel/alternative.c+12 -80 replies
19/27locking/atomics, kcsan: Add KCSAN instrumentationinclude/asm-generic/atomic-instrumented.h scripts/atomic/gen-atomic-instrumented.sh+212 -1920 replies
20/27asm-generic/atomic: Use __always_inline for pure wrappersinclude/asm-generic/atomic-instrumented.h include/asm-generic/atomic-long.h scripts/atomic/gen-atomic-instrumented.sh +1 more+340 -3360 replies
21/27asm-generic/atomic: Use __always_inline for fallback wrappersinclude/linux/atomic-fallback.h scripts/atomic/fallbacks/acquire scripts/atomic/fallbacks/add_negative +18 more+192 -1880 replies
22/27compiler: Simple READ/WRITE_ONCE() implementationsinclude/linux/compiler.h+8 -00 replies
23/27locking/atomics: Flip fallbacks and instrumentationarch/arm64/include/asm/atomic.h arch/x86/include/asm/atomic.h arch/x86/include/asm/atomic64_32.h +25 more+2403 -820 replies
24/27x86/int3: Avoid atomic instrumentationarch/x86/kernel/alternative.c+3 -30 replies
25/27lib/bsearch: Provide __always_inline variantinclude/linux/bsearch.h lib/bsearch.c+26 -220 replies
26/27x86/int3: Inline bsearch()arch/x86/kernel/alternative.c+4 -50 replies
27/27x86/int3: Ensure that poke_int3_handler() is not sanitizedarch/x86/kernel/alternative.c arch/x86/kernel/traps.c include/linux/compiler-clang.h +3 more+21 -20 replies

Reviews trailers per patch

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

PatchPetr MladekWill DeaconMarc ZyngierSteven Rostedt (VMware)Thomas GleixnerMark RutlandDmitry VyukovPaul E. McKenneyMasami HiramatsuJoel Fernandes (Google)Andy LutomirskiFrederic Weisbecker
1/27R-b R-b
2/27R-b A-b A-b R-b
3/27
4/27R-b
5/27A-b R-b
6/27A-b
7/27R-b
8/27R-b R-b A-b R-b
9/27R-b R-b
10/27R-b
11/27R-b
12/27R-b
13/27R-b
14/27
15/27R-b
16/27R-b
17/27
18/27Not-Signed-off-by
19/27R-b
20/27A-b
21/27A-b
22/27
23/27
24/27
25/27
26/27
27/27A-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 12 reviewers.

Read the v4 thread

Cover letter [PATCH v4 00/27] tracing vs world

Hi all,

These here patches are the result of Mathieu and Steve trying to get commit 865e63b04e9b2 ("tracing: Add back in rcu_irq_enter/exit_irqson() for rcuidle tracepoints") reverted again.

One of the things discovered is that tracing MUST NOT happen before nmi_enter() or after nmi_exit(). Audit results of the previous version are still valid.

This then snowballed into auditing other exceptions, notably #MC, and #BP. Lots of patches came out of that.

I would love for some tooling in this area. Dan, smatch has full callchains right? Would it be possible to have an __assert_no_tracing__() marker of sorts that validates that no possible callchain reaching that assertion has hit tracing before that point?

It would mean you have to handle the various means of 'notrace' annotation (both the function attribute as well as the Makefile rules), recognising tracepoints and ideally handling NOKPROBE annotations.

NOTE:
patches 19,20,21 already live in tip/locking/kcsan and are included here because 20,21 are needed for the patches following to make sense. If/when this gets merged, we need to figure out how to resolve this.

Changes since -v3:

- Replaced the #DF patch with one from Boris
- Moved trace_rcu_{enter,exit}() into rcupdate.h
- Flipped TIF_SIGPENDING and TIF_NOTIFY_RESUME handling
- Added comment to nmi_enter()
- fixed various compile fails
- inlined bsearch()
- Added lockdep checking for USED <- IN-NMI recursion
- Added rcu_nmi_enter vs kprobes comment

Changes since -v2:

- #MC / ist_enter() audit -- first 4 patches. After this in_nmi() should always be set 'correctly'.
- RCU IRQ enter/exit function simplification
- #BP / poke_int3_handler() audit -- last many patches.
- pulled in some locking/kcsan patches

Changes since -v1:

- Added tags
- Changed #4; changed nmi_enter() to use __preempt_count_add() vs marking preempt_count_add() notrace.
- Changed #5; confusion on which functions are notrace due to Makefile
- Added #9; remove limitation on the perf-function-trace coupling