Skip to content

Commit f14bf6a

Browse files
shiloongingomolnar
authored andcommitted
x86/unwind/orc: Remove boot-time ORC unwind tables sorting
Now that the orc_unwind and orc_unwind_ip tables are sorted at build time, remove the boot time sorting pass. No change in functionality. [ mingo: Rewrote the changelog and code comments. ] Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: linux-kbuild@vger.kernel.org Link: https://lkml.kernel.org/r/20191204004633.88660-8-shile.zhang@linux.alibaba.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 57fa189 commit f14bf6a

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎arch/x86/kernel/unwind_orc.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,11 @@ void __init unwind_init(void)
273273
return;
274274
}
275275

276-
/* Sort the .orc_unwind and .orc_unwind_ip tables: */
277-
sort(__start_orc_unwind_ip, num_entries, sizeof(int), orc_sort_cmp,
278-
orc_sort_swap);
276+
/*
277+
* Note, the orc_unwind and orc_unwind_ip tables were already
278+
* sorted at build time via the 'sorttable' tool.
279+
* It's ready for binary search straight away, no need to sort it.
280+
*/
279281

280282
/* Initialize the fast lookup table: */
281283
lookup_num_blocks = orc_lookup_end - orc_lookup;

‎scripts/link-vmlinux.sh‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,10 @@ vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o}
306306

307307
if [ -n "${CONFIG_BUILDTIME_TABLE_SORT}" ]; then
308308
info SORTTAB vmlinux
309-
sorttable vmlinux
309+
if ! sorttable vmlinux; then
310+
echo >&2 Failed to sort kernel tables
311+
exit 1
312+
fi
310313
fi
311314

312315
info SYSMAP System.map

0 commit comments

Comments
 (0)