linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] Speed booting by sorting ORC unwind tables at build time
@ 2019-11-07 14:32 shile.zhang
  2019-11-07 14:32 ` [RFC PATCH 1/4] scripts: Add sortorctable to sort ORC unwind tables shile.zhang
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: shile.zhang @ 2019-11-07 14:32 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Josh Poimboeuf, x86
  Cc: H . Peter Anvin, linux-kernel, linux-kbuild, Shile Zhang

From: Shile Zhang <shile.zhang@linux.alibaba.com>

Hi,

I found the unwind_init taken long time (more than 90ms) in kernel
booting, mainly spent on sorting the two ORC unwind tables, orc_unwind
and orc_unwind_ip.

I also noticed that this issued has reported and discussed last year:
https://lkml.org/lkml/2018/10/8/342
But seems no final solution until now, I tried to sort the ORC tables at
build time, followed the helpful hints from Josh and Ingo in that thread.
And mainly referred the implementation of 'sortextable' tool:
https://lore.kernel.org/linux-mips/1334872799-14589-1-git-send-email-ddaney.cavm@gmail.com/

What I did:

- Add a Kconfig to control build-time sorting or runtime sorting;
- Referred 'sortextable', create a similar helper tool 'sortorctable',
  help to sort the ORC unwind tables at vmlinux link process.

One potential improvement is to sort the module ORC tables in future.

Thanks!

Shile Zhang (4):
  scripts: Add sortorctable to sort ORC unwind tables
  kbuild: Sort ORC unwind tables in vmlinux link process
  x86/unwind/orc: Skip sorting if BUILDTIME_ORCTABLE_SORT is configured
  x86/Kconfig: Add a Kconfig option to sort ORC tables at build time

 arch/x86/Kconfig.debug       |   9 ++
 arch/x86/kernel/unwind_orc.c |   2 +
 scripts/.gitignore           |   1 +
 scripts/Makefile             |   2 +
 scripts/link-vmlinux.sh      |  10 ++
 scripts/sortorctable.c       | 246 +++++++++++++++++++++++++++++++++++
 scripts/sortorctable.h       |  25 ++++
 7 files changed, 295 insertions(+)
 create mode 100644 scripts/sortorctable.c
 create mode 100644 scripts/sortorctable.h

-- 
2.24.0.rc2


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

end of thread, other threads:[~2019-11-11  2:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07 14:32 [RFC PATCH 0/4] Speed booting by sorting ORC unwind tables at build time shile.zhang
2019-11-07 14:32 ` [RFC PATCH 1/4] scripts: Add sortorctable to sort ORC unwind tables shile.zhang
2019-11-07 14:32 ` [RFC PATCH 2/4] kbuild: Sort ORC unwind tables in vmlinux link process shile.zhang
2019-11-07 14:32 ` [RFC PATCH 3/4] x86/unwind/orc: Skip sorting if BUILDTIME_ORCTABLE_SORT is configured shile.zhang
2019-11-07 14:32 ` [RFC PATCH 4/4] x86/Kconfig: Add a Kconfig option to sort ORC tables at build time shile.zhang
2019-11-07 15:22 ` [RFC PATCH 0/4] Speed booting by sorting ORC unwind " Peter Zijlstra
2019-11-08  1:42   ` Shile Zhang
2019-11-08  9:21     ` Peter Zijlstra
2019-11-08  9:25       ` Peter Zijlstra
2019-11-11  2:44         ` Shile Zhang
2019-11-07 15:46 ` Josh Poimboeuf
2019-11-08  1:43   ` Shile Zhang

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).