public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] faster kexec reboot
@ 2022-07-25  8:38 Albert Huang
  2022-07-25  8:38 ` [PATCH 1/4] kexec: reuse crash kernel reserved memory for normal kexec Albert Huang
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Albert Huang @ 2022-07-25  8:38 UTC (permalink / raw)
  Cc: huangjie.albert, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, H. Peter Anvin, Eric Biederman, Masahiro Yamada,
	Michal Marek, Nick Desaulniers, Kirill A. Shutemov, Michael Roth,
	Kuppuswamy Sathyanarayanan, Nathan Chancellor, Peter Zijlstra,
	Sean Christopherson, Joerg Roedel, Mark Rutland, Kees Cook,
	linux-kernel, kexec, linux-kbuild

From: "huangjie.albert" <huangjie.albert@bytedance.com>

In many time-sensitive scenarios, we need a shorter time to restart 
the kernel. However, in the current kexec fast restart code, there 
are many places in the memory copy operation, verification operation 
and decompression operation, which take more time than 500ms. Through 
the following patch series. machine_kexec-->start_kernel only takes 15ms

How to measure time:

c code:
uint64_t current_cycles(void)
{
    uint32_t low, high;
    asm volatile("rdtsc" : "=a"(low), "=d"(high));
    return ((uint64_t)low) | ((uint64_t)high << 32);
}
assembly code:
       pushq %rax
       pushq %rdx
       rdtsc
       mov   %eax,%eax
       shl   $0x20,%rdx
       or    %rax,%rdx
       movq  %rdx,0x840(%r14)
       popq  %rdx
       popq  %rax
the timestamp may store in boot_params or kexec control page, so we can
get the all timestamp after kernel boot up.

huangjie.albert (4):
  kexec: reuse crash kernel reserved memory for normal kexec
  kexec: add CONFING_KEXEC_PURGATORY_SKIP_SIG
  x86: Support the uncompressed kernel to speed up booting
  x86: boot: avoid memory copy if kernel is uncompressed

 arch/x86/Kconfig                   | 10 +++++++++
 arch/x86/boot/compressed/Makefile  |  5 ++++-
 arch/x86/boot/compressed/head_64.S |  8 +++++--
 arch/x86/boot/compressed/misc.c    | 35 +++++++++++++++++++++++++-----
 arch/x86/purgatory/purgatory.c     |  7 ++++++
 include/linux/kexec.h              |  9 ++++----
 include/uapi/linux/kexec.h         |  2 ++
 kernel/kexec.c                     | 19 +++++++++++++++-
 kernel/kexec_core.c                | 16 ++++++++------
 kernel/kexec_file.c                | 20 +++++++++++++++--
 scripts/Makefile.lib               |  5 +++++
 11 files changed, 114 insertions(+), 22 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-07-28  1:58 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-25  8:38 [PATCH 0/4] faster kexec reboot Albert Huang
2022-07-25  8:38 ` [PATCH 1/4] kexec: reuse crash kernel reserved memory for normal kexec Albert Huang
2022-07-25 12:02   ` Jason A. Donenfeld
2022-07-25 12:56     ` Fwd: [External] " 黄杰
2022-07-25 13:30     ` 黄杰
2022-07-25  8:38 ` [PATCH 2/4] kexec: add CONFING_KEXEC_PURGATORY_SKIP_SIG Albert Huang
2022-07-25 12:15   ` Jason A. Donenfeld
2022-07-25 13:32     ` [External] " 黄杰
2022-07-28  1:57       ` 黄杰
2022-07-25 12:56   ` Fwd: " 黄杰
2022-07-25  8:38 ` [PATCH 3/4] x86: Support the uncompressed kernel to speed up booting Albert Huang
2022-07-25 12:55   ` Fwd: " 黄杰
2022-07-25 16:57   ` Eric W. Biederman
2022-07-25  8:38 ` [PATCH 4/4] x86: boot: avoid memory copy if kernel is uncompressed Albert Huang
2022-07-25 12:55   ` Fwd: " 黄杰
2022-07-25 12:54 ` Fwd: [PATCH 0/4] faster kexec reboot 黄杰
2022-07-25 17:04 ` Eric W. Biederman
2022-07-26  5:53   ` [External] " 黄杰
2022-07-28  1:55     ` 黄杰

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox