Skip to content

RFC Flush nvdimm/pmem to memory before machine restart

Mathieu Desnoyers linux-arm-kernel lkml llvm nvdimm oe-kbuild-all 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4kernel/reboot: Introduce pre_restart notifiersinclude/linux/reboot.h kernel/reboot.c+55 -00 replies
2/4nvdimm/pmem: Flush to memory before machine restartdrivers/nvdimm/pmem.c drivers/nvdimm/pmem.h+30 -10 replies
3/4arm64: Invoke pre_restart notifiersarch/arm64/kernel/process.c+2 -00 replies
4/4x86: Invoke pre_restart notifiersarch/x86/kernel/reboot.c+5 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/4] Flush nvdimm/pmem to memory before machine restart

Introduce a new pre_restart notifier chain for callbacks that need to be executed after the system has been made quiescent with syscore_shutdown(), before machine restart.

Register pre-restart notifiers to flush pmem areas from CPU data cache to memory on reboot, immediately before restarting the machine. This ensures all other CPUs are quiescent before the pmem data is flushed to memory.

The use-case for this new notifier chain is to preserve tracing data within pmem areas on systems where the BIOS does not clear memory across warm reboots.

I did an earlier POC that flushed caches on panic/die oops notifiers [1], but it did not cover the reboot case. I've been made aware that some distribution vendors have started shipping their own modified version of my earlier POC patch. This makes a strong argument for upstreaming this work.

Cc Vishal Verma <[email protected]>
Cc Dave Jiang <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>

Mathieu Desnoyers (4):
kernel/reboot: Introduce pre_restart notifiers nvdimm/pmem: Flush to memory before machine restart
arm64: Invoke pre_restart notifiers
x86: Invoke pre_restart notifiers

 arch/arm64/kernel/process.c |  2 ++
 arch/x86/kernel/reboot.c    |  7 +++--
 drivers/nvdimm/pmem.c       | 29 ++++++++++++++++++++-
 drivers/nvdimm/pmem.h       |  2 ++
 include/linux/reboot.h      |  4 +++
 kernel/reboot.c             | 51 +++++++++++++++++++++++++++++++++++++
 6 files changed, 92 insertions(+), 3 deletions(-)
Signature · 1 line
2.39.2