Skip to content

RFC Print CPU at segfault time

[email protected] lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 31 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5entry: Pass pt_regs to irqentry_exit_cond_resched()arch/arm64/include/asm/preempt.h arch/arm64/kernel/entry-common.c arch/x86/entry/common.c +3 more+43 -358 replies
2/5entry: Add calls for save/restore auxiliary pt_regsinclude/linux/entry-common.h kernel/entry/common.c+22 -29 replies
3/5x86/entry: Add auxiliary pt_regs spacearch/x86/Kconfig arch/x86/entry/calling.h arch/x86/entry/entry_64.S +4 more+90 -01 reply
4/5x86,mm: print likely CPU at segfault timearch/x86/mm/fault.c+10 -00 replies
5/5x86/entry: Store CPU info on exception entryarch/x86/Kconfig arch/x86/include/asm/entry-common.h arch/x86/include/asm/ptrace.h +1 more+16 -313 replies

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by.

PatchRik van Riel
1/5A-b
2/5A-b
3/5A-b
4/5
5/5A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 0/5] Print CPU at segfault time

From: Ira Weiny <[email protected]>

Rik reported that the knowledge of which CPU's are seeing faults can help in determining which CPUs are failing in a large data center.[1]

Storing the CPU at exception entry time allows this print to report the CPU which actually took the exception. This still may not be the CPU which is failing but it should be closer.

Dave and Boris recognized that the auxiliary pt_regs work I did for the PKS series could help to store this value and avoid passing the CPU throughout the fault handler call stack.

I'm posting this RFC for a few reasons.

1) I've left in arch_restore_aux_pt_regs(). This is called on exception exit and is not needed for this use case but I believe it is better to leave it for symmetry within the generic entry code. This also means that patch 1/5 could be dropped completely.

2) I want to see if 0day has any issues with the Kconfig option changes I made which may creep in from a 32bit build.

3) The final patch could be squashed with Rik's but it seemed better to leave them split for authorship clarity.

Compile tested only.

[1] https://lore.kernel.org/all/[email protected]/

Ira Weiny (4):
entry: Pass pt_regs to irqentry_exit_cond_resched()
entry: Add calls for save/restore auxiliary pt_regs x86/entry: Add auxiliary pt_regs space x86/entry: Store CPU info on exception entry

Rik van Riel (1):
x86,mm: print likely CPU at segfault time

 arch/arm64/include/asm/preempt.h    |  2 +-
 arch/arm64/kernel/entry-common.c    |  4 +--
 arch/x86/Kconfig                    |  4 +++
 arch/x86/entry/calling.h            | 19 ++++++++++++++
 arch/x86/entry/common.c             |  2 +-
 arch/x86/entry/entry_64.S           | 22 ++++++++++++++++
 arch/x86/entry/entry_64_compat.S    |  6 +++++
 arch/x86/include/asm/entry-common.h | 12 +++++++++
 arch/x86/include/asm/ptrace.h       | 19 ++++++++++++++
 arch/x86/kernel/asm-offsets_64.c    | 15 +++++++++++
 arch/x86/kernel/head_64.S           |  6 +++++
 arch/x86/mm/fault.c                 | 10 ++++++++
 include/linux/entry-common.h        | 25 +++++++++++++-----
 kernel/entry/common.c               | 29 ++++++++++++++++-----
 kernel/sched/core.c                 | 40 ++++++++++++++---------------
 15 files changed, 178 insertions(+), 37 deletions(-)

base-commit: b2a88c212e652e94f1e4b635910972ac57ba4e97

Signature · 1 line
2.35.3