Skip to content

RFC Jump-based NMI-safe immediate values and markers for sched-devel.git

Mathieu Desnoyers lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest27 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/27From: Adrian Bunk <[email protected]>kernel/marker.c+1 -10 replies
2/27x86 NMI-safe INT3 and Page Faultarch/x86/kernel/entry_32.S arch/x86/kernel/entry_64.S include/asm-alpha/thread_info.h +4 more+142 -50 replies
3/27Check for breakpoint in text_poke to eliminate bug_onarch/x86/kernel/alternative.c+29 -200 replies
4/27Kprobes - use a mutex to protect the instruction pages list.kernel/kprobes.c+21 -60 replies
5/27Kprobes - do not use kprobes mutex in arch codearch/ia64/kernel/kprobes.c arch/powerpc/kernel/kprobes.c arch/s390/kernel/kprobes.c +2 more+0 -100 replies
6/27Kprobes - declare kprobe_mutex statickernel/kprobes.c+1 -10 replies
7/27Text Edit Lock - Architecture Independent Codeinclude/linux/memory.h mm/memory.c+41 -00 replies
8/27Text Edit Lock - kprobes architecture independent supportkernel/kprobes.c+13 -40 replies
9/27Add all cpus option to stop machine runinclude/linux/stop_machine.h kernel/stop_machine.c+31 -80 replies
10/27Immediate Values - Architecture Independent Codeinclude/asm-generic/vmlinux.lds.h include/linux/immediate.h include/linux/module.h +4 more+320 -10 replies
11/27Immediate Values - Kconfig menu in EMBEDDEDinit/Kconfig+18 -00 replies
12/27Immediate Values - x86 Optimizationarch/x86/Kconfig include/asm-x86/immediate.h+78 -00 replies
13/27Add text_poke and sync_core to powerpcinclude/asm-powerpc/cacheflush.h+3 -10 replies
14/27Immediate Values - Powerpc Optimizationarch/powerpc/Kconfig include/asm-powerpc/immediate.h+56 -00 replies
15/27Immediate Values - DocumentationDocumentation/immediate.txt+221 -05 replies
16/27Immediate Values Support initDocumentation/immediate.txt include/asm-generic/vmlinux.lds.h include/asm-powerpc/immediate.h +6 more+52 -173 replies
17/27Scheduler Profiling - Use Immediate Valuesarch/x86/kvm/x86.c include/linux/profile.h kernel/profile.c +1 more+16 -180 replies
18/27Markers - remove extra format argumentinclude/linux/marker.h kernel/marker.c+19 -220 replies
19/27Markers - define non optimized markerinclude/linux/marker.h+24 -50 replies
20/27Immediate Values - Move Kprobes x86 restore_interrupt to kdebug.hinclude/asm-x86/kdebug.h include/asm-x86/kprobes.h+12 -90 replies
21/27Add __discard section to x86arch/x86/kernel/vmlinux_32.lds.S arch/x86/kernel/vmlinux_64.lds.S+2 -00 replies
22/27Immediate Values - x86 Optimization NMI and MCE supportarch/x86/kernel/Makefile arch/x86/kernel/immediate.c arch/x86/kernel/traps_32.c +1 more+339 -100 replies
23/27Immediate Values - Powerpc Optimization NMI MCE supportarch/powerpc/kernel/Makefile arch/powerpc/kernel/immediate.c include/asm-powerpc/immediate.h+92 -05 replies
24/27Immediate Values Use Arch NMI and MCE Supportinclude/linux/immediate.h kernel/immediate.c+3 -810 replies
25/27Linux Kernel Markers - Use Immediate ValuesDocumentation/markers.txt include/linux/marker.h kernel/marker.c +1 more+32 -100 replies
26/27Immediate Values - Jumparch/x86/kernel/immediate.c include/asm-powerpc/immediate.h include/asm-x86/immediate.h +2 more+359 -752 replies
27/27Markers use imv jumpinclude/linux/marker.h+1 -10 replies

Reviews trailers per patch

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

PatchMathieu DesnoyersAnanth N MavinakayanahalliMasami HiramatsuH. Peter Anvin
1/27A-b
2/27
3/27
4/27A-b A-b
5/27A-b A-b
6/27A-b A-b
7/27
8/27A-b
9/27
10/27
11/27
12/27
13/27
14/27
15/27
16/27
17/27
18/27
19/27
20/27A-b
21/27A-b
22/27
23/27
24/27
25/27
26/27
27/27

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

Read the v1 thread

Cover letter [RFC patch 00/27] Jump-based NMI-safe immediate values and markers for sched-devel.git

Hi Ingo,

Here is the patchset you requested. I did not port the marker reintegration to your sched-devel tree though, because many changes happened since you have done the original work.

It applies on top of sched-devel.git latest.

You will notice that I implemented what we discussed yesterday : using nops and jump for the heavily optimized version of markers. Comments are welcome. Running this with my ~120 LTTng markers on x86_32 detects 97% of the sites. 4 out of 120 did had to fall back on the standard immediate values because they have been manipulated by gcc optimizations. The sched-devel.git port has been tested on x86_32. Patches before the port are tested on x86_32 and x86_64.

Note that some folding of the immediate values patches could eventually be required. At that point, add-all-cpus-option-to-stop-machine-run.patch would become useless.

The series order is the following :

make-marker_debug-static.patch # in -mm x86-nmi-safe-int3-and-page-fault.patch check-for-breakpoint-in-text-poke-to-eliminate-bug-on.patch #Kprobes mutex cleanup
kprobes-use-mutex-for-insn-pages.patch kprobes-dont-use-kprobes-mutex-in-arch-code.patch kprobes-declare-kprobes-mutex-static.patch
#Text Edit Lock (depends on Enhance DEBUG_RODATA and kprobes mutex cleanup) text-edit-lock-architecture-independent-code.patch text-edit-lock-kprobes-architecture-independent-support.patch
#
#Immediate Values
add-all-cpus-option-to-stop-machine-run.patch immediate-values-architecture-independent-code.patch immediate-values-kconfig-menu-in-embedded.patch immediate-values-x86-optimization.patch add-text-poke-and-sync-core-to-powerpc.patch immediate-values-powerpc-optimization.patch immediate-values-documentation.patch immediate-values-support-init.patch
#
scheduler-profiling-use-immediate-values.patch
#
markers-remove-extra-format-argument.patch markers-define-non-optimized-marker.patch
# immediate-values-move-kprobes-x86-restore-interrupt-to-kdebug-h.patch add-discard-section-to-x86.patch immediate-values-x86-optimization-nmi-mce-support.patch immediate-values-powerpc-optimization-nmi-mce-support.patch immediate-values-use-arch-nmi-mce-support.patch linux-kernel-markers-immediate-values.patch
#
immediate-values-jump.patch
markers-use-imv-jump.patch

Mathieu

Signature · 3 lines
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68