lkml.org 
[lkml]   [2022]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectFwd: [PATCH 0/4] faster kexec reboot
---------- Forwarded message ---------
发件人: Albert Huang <huangjie.albert@bytedance.com>
Date: 2022年7月25日周一 16:39
Subject: [PATCH 0/4] faster kexec reboot
To:
Cc: huangjie.albert <huangjie.albert@bytedance.com>, Thomas Gleixner
<tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov
<bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
<x86@kernel.org>, H. Peter Anvin <hpa@zytor.com>, Eric Biederman
<ebiederm@xmission.com>, Masahiro Yamada <masahiroy@kernel.org>,
Michal Marek <michal.lkml@markovi.net>, Nick Desaulniers
<ndesaulniers@google.com>, Kirill A. Shutemov
<kirill.shutemov@linux.intel.com>, Michael Roth
<michael.roth@amd.com>, Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@linux.intel.com>, Nathan Chancellor
<nathan@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Sean
Christopherson <seanjc@google.com>, Joerg Roedel <jroedel@suse.de>,
Mark Rutland <mark.rutland@arm.com>, Kees Cook
<keescook@chromium.org>, <linux-kernel@vger.kernel.org>,
<kexec@lists.infradead.org>, <linux-kbuild@vger.kernel.org>


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

\
 
 \ /
  Last update: 2022-07-25 14:55    [W:0.280 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site