Skip to content

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 Latest3 patches 1 replyIn review

Changes from RFC from the cover letter

Drop patch 1 as I misunderstood the code and it is not needed for this
use case
Combine patch 2 and 5 into a patch 3 which stores the CPU only for page
faults

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3x86,mm: print likely CPU at segfault timearch/x86/mm/fault.c+10 -00 replies
2/3x86/entry: Add auxiliary pt_regs spacearch/x86/Kconfig arch/x86/entry/calling.h arch/x86/entry/entry_64.S +4 more+90 -00 replies
3/3x86/mm: Store CPU info on exception entryarch/x86/Kconfig arch/x86/include/asm/ptrace.h arch/x86/mm/fault.c+12 -30 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchIra Weiny
1/3T-b R-b
2/3
3/3

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

Read the v1 thread

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

From: Ira Weiny <[email protected]>

Changes from RFC:
Drop patch 1 as I misunderstood the code and it is not needed for this
use case
Combine patch 2 and 5 into a patch 3 which stores the CPU only for page
faults

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.

The patches I sent for RFC had a lot more overhead than is needed to report the CPU in a page fault.[2] After the discussions the generic save/restore of the auxiliary pt_regs is overkill for the current use case. Skip that overhead and only store the CPU in the page fault path.

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

Ira Weiny (2):
x86/entry: Add auxiliary pt_regs space
x86/mm: Store CPU info on exception entry

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

 arch/x86/Kconfig                 |  4 ++++
 arch/x86/entry/calling.h         | 19 +++++++++++++++++++
 arch/x86/entry/entry_64.S        | 22 ++++++++++++++++++++++
 arch/x86/entry/entry_64_compat.S |  6 ++++++
 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              | 18 ++++++++++++++++++
 8 files changed, 109 insertions(+)

base-commit: d4252071b97d2027d246f6a82cbee4d52f618b47

Signature · 1 line
2.35.3