linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v3 0/7] Speed booting by sorting ORC unwind tables at build time
@ 2019-11-15  6:47 Shile Zhang
  2019-11-15  6:47 ` [RFC PATCH v3 1/7] scripts/sortextable: Rewrite error/success handling Shile Zhang
                   ` (7 more replies)
  0 siblings, 8 replies; 22+ messages in thread
From: Shile Zhang @ 2019-11-15  6:47 UTC (permalink / raw)
  To: Peter Zijlstra, Josh Poimboeuf, Masahiro Yamada, Michal Marek,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
  Cc: H . Peter Anvin, linux-kernel, linux-kbuild, Shile Zhang

Hi,

I refactored the sortextable code and add ORC unwind tables sort
support, for kernel boot speedup by sorting kernel tables at build time
as much as possible.

Followed Peter's suggestion, I put ORC tables sort into a separated
thread makes these tables sort concurrently. That helps to avoid
kernel's link time as possible.

What I did:
[1-4]	: refacorting code sortextable.{ch}, for more readable and
	  extendable, prepare for further rework;
[5]	: rename the sortextable to sorttable, and related Kconfig, for
	  commonly extend.
[6-7]	: Add ORC unwind tables sorting, and remove the runtime sort.

Further works:
Put more kernel tables be sorted at build time:
- __jump_table:
  I found jump table sort in jump_label_init() does not cost more boot
  time, seems not more benefit to sort it at build time. Maybe can
  consider it in future for more boot-time sensitive case.
- .static_call_sites:
  This tables not merged yet, needs to check the runtime sort cost in
  future.
  https://lore.kernel.org/lkml/20191007081716.07616230.8@infradead.org/

Thanks!

Changes from RFC v3:
- Discard new added sortorctable tool and related Kconfig changes.
- Refactored sortextable, makes it more readable and extendable.
- Rename 'sortextable' to 'sorttable', for more kernel tables extend.
- Add ORC unwind tables sort into sorttable.
- Remove the runtime ORC tables sort.

Changes from RFC v2:
- Removed new added Kconfig and runtime sort code, advised by Josh Poimboeuf.
- Some minor refactoring.
https://www.lkml.org/lkml/2019/11/8/56

v1:
- Added a new sortorctable tool to sort ORC unwind tables at build time,
  same as sortextable.
- Add a new Kconfigure to control if ORC unwind tables sort at build
  time.
https://www.lkml.org/lkml/2019/11/7/611

Shile Zhang (7):
  scripts/sortextable: Rewrite error/success handling
  scripts/sortextable: kernel coding style formating
  scripts/sortextable: Remove dead code
  scripts/sortextable: refactor do_func() function
  scripts/sorttable: rename sortextable to sorttable
  scripts/sorttable: Add ORC unwind tables sort concurrently
  x86/unwind/orc: remove run-time ORC unwind tables sort

 arch/arc/Kconfig                       |   2 +-
 arch/arm/Kconfig                       |   2 +-
 arch/arm64/Kconfig                     |   2 +-
 arch/microblaze/Kconfig                |   2 +-
 arch/mips/Kconfig                      |   2 +-
 arch/parisc/Kconfig                    |   2 +-
 arch/parisc/kernel/vmlinux.lds.S       |   2 +-
 arch/powerpc/Kconfig                   |   2 +-
 arch/s390/Kconfig                      |   2 +-
 arch/x86/Kconfig                       |   2 +-
 arch/x86/kernel/unwind_orc.c           |   8 +-
 arch/xtensa/Kconfig                    |   2 +-
 init/Kconfig                           |   2 +-
 scripts/.gitignore                     |   2 +-
 scripts/Makefile                       |   9 +-
 scripts/link-vmlinux.sh                |  10 +-
 scripts/sortextable.h                  | 209 -------------
 scripts/{sortextable.c => sorttable.c} | 299 ++++++++----------
 scripts/sorttable.h                    | 412 +++++++++++++++++++++++++
 19 files changed, 578 insertions(+), 395 deletions(-)
 delete mode 100644 scripts/sortextable.h
 rename scripts/{sortextable.c => sorttable.c} (67%)
 create mode 100644 scripts/sorttable.h

-- 
2.24.0.rc2


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

end of thread, other threads:[~2019-11-18 14:41 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-15  6:47 [RFC PATCH v3 0/7] Speed booting by sorting ORC unwind tables at build time Shile Zhang
2019-11-15  6:47 ` [RFC PATCH v3 1/7] scripts/sortextable: Rewrite error/success handling Shile Zhang
2019-11-15  6:47 ` [RFC PATCH v3 2/7] scripts/sortextable: kernel coding style formating Shile Zhang
2019-11-15  6:47 ` [RFC PATCH v3 3/7] scripts/sortextable: Remove dead code Shile Zhang
2019-11-15  6:47 ` [RFC PATCH v3 4/7] scripts/sortextable: refactor do_func() function Shile Zhang
2019-11-15  6:47 ` [RFC PATCH v3 5/7] scripts/sorttable: rename sortextable to sorttable Shile Zhang
2019-11-15  6:47 ` [RFC PATCH v3 6/7] scripts/sorttable: Add ORC unwind tables sort concurrently Shile Zhang
2019-11-15  9:07   ` Peter Zijlstra
2019-11-15  9:43     ` Shile Zhang
2019-11-15 10:33       ` Peter Zijlstra
2019-11-15 17:24       ` Andy Lutomirski
2019-11-18 11:43         ` Shile Zhang
2019-11-15  9:19   ` Peter Zijlstra
2019-11-15  9:45     ` Shile Zhang
2019-11-15  6:47 ` [RFC PATCH v3 7/7] x86/unwind/orc: remove run-time ORC unwind tables sort Shile Zhang
2019-11-15 16:51   ` David Laight
2019-11-15 17:46     ` Josh Poimboeuf
2019-11-18 10:05       ` David Laight
2019-11-18 10:50         ` Shile Zhang
2019-11-18 14:41         ` Josh Poimboeuf
2019-11-15  7:25 ` [RFC PATCH v3 0/7] Speed booting by sorting ORC unwind tables at build time Ingo Molnar
2019-11-15  8:24   ` 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).