linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/8] arm64: MMU enabled kexec relocation
@ 2019-08-01 15:24 Pavel Tatashin
  2019-08-01 15:24 ` [PATCH v1 1/8] kexec: quiet down kexec reboot Pavel Tatashin
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Pavel Tatashin @ 2019-08-01 15:24 UTC (permalink / raw)
  To: pasha.tatashin, jmorris, sashal, ebiederm, kexec, linux-kernel,
	corbet, catalin.marinas, will, linux-arm-kernel, marc.zyngier,
	james.morse, vladimir.murzin, matthias.bgg, bhsharma, linux-mm

Enable MMU during kexec relocation in order to improve reboot performance.

If kexec functionality is used for a fast system update, with a minimal
downtime, the relocation of kernel + initramfs takes a significant portion
of reboot.

The reason for slow relocation is because it is done without MMU, and thus
not benefiting from D-Cache.

Performance data
----------------
For this experiment, the size of kernel plus initramfs is small, only 25M.
If initramfs was larger, than the improvements would be greater, as time
spent in relocation is proportional to the size of relocation.

Previously:
kernel shutdown	0.022131328s
relocation	0.440510736s
kernel startup	0.294706768s

Relocation was taking: 58.2% of reboot time

Now:
kernel shutdown	0.032066576s
relocation	0.022158152s
kernel startup	0.296055880s

Now: Relocation takes 6.3% of reboot time

Total reboot is x2.16 times faster.

Previous approaches and discussions
-----------------------------------
https://lore.kernel.org/lkml/20190709182014.16052-1-pasha.tatashin@soleen.com
reserve space for kexec to avoid relocation, involves changes to generic code
to optimize a problem that exists on arm64 only:

https://lore.kernel.org/lkml/20190716165641.6990-1-pasha.tatashin@soleen.com
The first attempt to enable MMU, some bugs that prevented performance
improvement. The page tables unnecessary configured idmap for the whole
physical space.

https://lore.kernel.org/lkml/20190731153857.4045-1-pasha.tatashin@soleen.com
No linear copy, bug with EL2 reboots.

Pavel Tatashin (8):
  kexec: quiet down kexec reboot
  arm64, mm: transitional tables
  arm64: hibernate: switch to transtional page tables.
  kexec: add machine_kexec_post_load()
  arm64, kexec: move relocation function setup and clean up
  arm64, kexec: add expandable argument to relocation function
  arm64, kexec: configure transitional page table for kexec
  arm64, kexec: enable MMU during kexec relocation

 arch/arm64/Kconfig                     |   4 +
 arch/arm64/include/asm/kexec.h         |  51 ++++-
 arch/arm64/include/asm/pgtable-hwdef.h |   1 +
 arch/arm64/include/asm/trans_table.h   |  68 ++++++
 arch/arm64/kernel/asm-offsets.c        |  14 ++
 arch/arm64/kernel/cpu-reset.S          |   4 +-
 arch/arm64/kernel/cpu-reset.h          |   8 +-
 arch/arm64/kernel/hibernate.c          | 261 ++++++-----------------
 arch/arm64/kernel/machine_kexec.c      | 199 ++++++++++++++----
 arch/arm64/kernel/relocate_kernel.S    | 196 +++++++++---------
 arch/arm64/mm/Makefile                 |   1 +
 arch/arm64/mm/trans_table.c            | 273 +++++++++++++++++++++++++
 kernel/kexec.c                         |   4 +
 kernel/kexec_core.c                    |   8 +-
 kernel/kexec_file.c                    |   4 +
 kernel/kexec_internal.h                |   2 +
 16 files changed, 758 insertions(+), 340 deletions(-)
 create mode 100644 arch/arm64/include/asm/trans_table.h
 create mode 100644 arch/arm64/mm/trans_table.c

-- 
2.22.0


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

end of thread, other threads:[~2019-08-16 19:19 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-01 15:24 [PATCH v1 0/8] arm64: MMU enabled kexec relocation Pavel Tatashin
2019-08-01 15:24 ` [PATCH v1 1/8] kexec: quiet down kexec reboot Pavel Tatashin
2019-08-01 15:24 ` [PATCH v1 2/8] arm64, mm: transitional tables Pavel Tatashin
2019-08-15 18:11   ` James Morse
2019-08-15 20:18     ` Pavel Tatashin
2019-08-01 15:24 ` [PATCH v1 3/8] arm64: hibernate: switch to transtional page tables Pavel Tatashin
2019-08-01 15:24 ` [PATCH v1 4/8] kexec: add machine_kexec_post_load() Pavel Tatashin
2019-08-01 15:24 ` [PATCH v1 5/8] arm64, kexec: move relocation function setup and clean up Pavel Tatashin
2019-08-01 15:24 ` [PATCH v1 6/8] arm64, kexec: add expandable argument to relocation function Pavel Tatashin
2019-08-01 15:24 ` [PATCH v1 7/8] arm64, kexec: configure transitional page table for kexec Pavel Tatashin
2019-08-01 15:24 ` [PATCH v1 8/8] arm64, kexec: enable MMU during kexec relocation Pavel Tatashin
2019-08-08 18:44 ` [PATCH v1 0/8] arm64: MMU enabled " Pavel Tatashin
2019-08-15 17:16   ` Pavel Tatashin
2019-08-15 18:11   ` James Morse
2019-08-15 20:09     ` Pavel Tatashin
2019-08-16 18:17       ` James Morse
2019-08-16 19:19         ` Pavel Tatashin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).