2020-03-24 16:13:15

by Peter Zijlstra

[permalink] [raw]
Subject: [PATCH v3 12/26] objtool: Resize insn_hash

Perf shows we're spending a lot of time in find_insn() and the
statistics show we have around 3.2 million instruction. Increase the
hash table size to reduce the bucket load from around 50 to 3.

This shaves about 2s off of objtool on vmlinux.o runtime, down to 16s.

Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Josh Poimboeuf <[email protected]>
---
tools/objtool/check.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tools/objtool/check.h
+++ b/tools/objtool/check.h
@@ -50,7 +50,7 @@ struct instruction {
struct objtool_file {
struct elf *elf;
struct list_head insn_list;
- DECLARE_HASHTABLE(insn_hash, 16);
+ DECLARE_HASHTABLE(insn_hash, 20);
bool ignore_unreachables, c_file, hints, rodata;
};




2020-03-25 10:22:49

by Miroslav Benes

[permalink] [raw]
Subject: Re: [PATCH v3 12/26] objtool: Resize insn_hash

On Tue, 24 Mar 2020, Peter Zijlstra wrote:

> Perf shows we're spending a lot of time in find_insn() and the
> statistics show we have around 3.2 million instruction. Increase the
> hash table size to reduce the bucket load from around 50 to 3.
>
> This shaves about 2s off of objtool on vmlinux.o runtime, down to 16s.
>
> Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
> Acked-by: Josh Poimboeuf <[email protected]>

Reviewed-by: Miroslav Benes <[email protected]>

M

Subject: [tip: core/objtool] objtool: Resize insn_hash

The following commit has been merged into the core/objtool branch of tip:

Commit-ID: 513b5ca6b5fbeb766999fb1a4bc9a55c9fb7c9ca
Gitweb: https://git.kernel.org/tip/513b5ca6b5fbeb766999fb1a4bc9a55c9fb7c9ca
Author: Peter Zijlstra <[email protected]>
AuthorDate: Thu, 12 Mar 2020 10:20:46 +01:00
Committer: Peter Zijlstra <[email protected]>
CommitterDate: Wed, 25 Mar 2020 18:28:30 +01:00

objtool: Resize insn_hash

Perf shows we're spending a lot of time in find_insn() and the
statistics show we have around 3.2 million instruction. Increase the
hash table size to reduce the bucket load from around 50 to 3.

This shaves about 2s off of objtool on vmlinux.o runtime, down to 16s.

Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Miroslav Benes <[email protected]>
Acked-by: Josh Poimboeuf <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
---
tools/objtool/check.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/objtool/check.h b/tools/objtool/check.h
index 6d875ca..f0ce8ff 100644
--- a/tools/objtool/check.h
+++ b/tools/objtool/check.h
@@ -50,7 +50,7 @@ struct instruction {
struct objtool_file {
struct elf *elf;
struct list_head insn_list;
- DECLARE_HASHTABLE(insn_hash, 16);
+ DECLARE_HASHTABLE(insn_hash, 20);
bool ignore_unreachables, c_file, hints, rodata;
};