Re: [PATCH v3 0/3] Build ORC fast lookup table in scripts/sorttable tool

changhuaixin
2020-06-29T02:14:07Z

Hi Josh, will you please have a look at this patchset?

There might be another way to set SHT_PROGBITS of section .orc_lookup by writing section headers when orc_unwind and orc_unwind_ip tables are writen. It might be as follows:

diff --git a/tools/objtool/orc_gen.c b/tools/objtool/orc_gen.c
index 3f98dcfbc177..860d4dcec8e6 100644
--- a/tools/objtool/orc_gen.c
+++ b/tools/objtool/orc_gen.c
@@ -183,6 +183,10 @@ int create_orc_sections(struct objtool_file *file)
u_sec = elf_create_section(file->elf, ".orc_unwind",
sizeof(struct orc_entry), idx);

+ /* make flags of section orc_lookup right */
+ if (!elf_create_section(file->elf, ".orc_lookup", sizeof(int), 0))
+ return -1;
+

What do you think about this way of setting SHT_PROGBITS?

> On Jun 3, 2020, at 10:39 PM, Huaixin Chang <changhuaixin@linux.alibaba.com> wrote:
>
> Move building of fast lookup table from boot to sorttable tool. This saves us
> 6380us boot time on Intel(R) Xeon(R) CPU E5-2682 v4 @ 2.50GHz with cores. It
> adds a little more than 7ms to boot time when testing on the same CPU.
>
> Changelog v3:
> 1. Modify annotation of unwind_init().
>
> Changelog v2:
> 1. Type of section orc_lookup needs to be SHT_PROGBITS.
> 2. unwind_init() cannot be removed totally as setting lookup_num_blocks is needed.
>
> Huaixin Chang (3):
> scripts/sorttable: Change section type of orc_lookup to SHT_PROGBITS
> scripts/sorttable: Build orc fast lookup table via sorttable tool
> x86/unwind/orc: Simplify unwind_init() for x86 boot
>
> arch/x86/kernel/unwind_orc.c | 41 +---------------
> include/asm-generic/vmlinux.lds.h | 2 +
> scripts/sorttable.h | 99 ++++++++++++++++++++++++++++++++++++---
> 3 files changed, 96 insertions(+), 46 deletions(-)
>
> --
> 2.14.4.44.g2045bb6