Commit 1c34496
objtool: Remove instruction::list
Replace the instruction::list by allocating instructions in arrays of
256 entries and stringing them together by (amortized) find_insn().
This shrinks instruction by 16 bytes and brings it down to 128.
struct instruction {
- struct list_head list; /* 0 16 */
- struct hlist_node hash; /* 16 16 */
- struct list_head call_node; /* 32 16 */
- struct section * sec; /* 48 8 */
- long unsigned int offset; /* 56 8 */
- /* --- cacheline 1 boundary (64 bytes) --- */
- long unsigned int immediate; /* 64 8 */
- unsigned int len; /* 72 4 */
- u8 type; /* 76 1 */
-
- /* Bitfield combined with previous fields */
+ struct hlist_node hash; /* 0 16 */
+ struct list_head call_node; /* 16 16 */
+ struct section * sec; /* 32 8 */
+ long unsigned int offset; /* 40 8 */
+ long unsigned int immediate; /* 48 8 */
+ u8 len; /* 56 1 */
+ u8 prev_len; /* 57 1 */
+ u8 type; /* 58 1 */
+ s8 instr; /* 59 1 */
+ u32 idx:8; /* 60: 0 4 */
+ u32 dead_end:1; /* 60: 8 4 */
+ u32 ignore:1; /* 60: 9 4 */
+ u32 ignore_alts:1; /* 60:10 4 */
+ u32 hint:1; /* 60:11 4 */
+ u32 save:1; /* 60:12 4 */
+ u32 restore:1; /* 60:13 4 */
+ u32 retpoline_safe:1; /* 60:14 4 */
+ u32 noendbr:1; /* 60:15 4 */
+ u32 entry:1; /* 60:16 4 */
+ u32 visited:4; /* 60:17 4 */
+ u32 no_reloc:1; /* 60:21 4 */
- u16 dead_end:1; /* 76: 8 2 */
- u16 ignore:1; /* 76: 9 2 */
- u16 ignore_alts:1; /* 76:10 2 */
- u16 hint:1; /* 76:11 2 */
- u16 save:1; /* 76:12 2 */
- u16 restore:1; /* 76:13 2 */
- u16 retpoline_safe:1; /* 76:14 2 */
- u16 noendbr:1; /* 76:15 2 */
- u16 entry:1; /* 78: 0 2 */
- u16 visited:4; /* 78: 1 2 */
- u16 no_reloc:1; /* 78: 5 2 */
+ /* XXX 10 bits hole, try to pack */
- /* XXX 2 bits hole, try to pack */
- /* Bitfield combined with next fields */
-
- s8 instr; /* 79 1 */
- struct alt_group * alt_group; /* 80 8 */
- struct instruction * jump_dest; /* 88 8 */
- struct instruction * first_jump_src; /* 96 8 */
+ /* --- cacheline 1 boundary (64 bytes) --- */
+ struct alt_group * alt_group; /* 64 8 */
+ struct instruction * jump_dest; /* 72 8 */
+ struct instruction * first_jump_src; /* 80 8 */
union {
- struct symbol * _call_dest; /* 104 8 */
- struct reloc * _jump_table; /* 104 8 */
- }; /* 104 8 */
- struct alternative * alts; /* 112 8 */
- struct symbol * sym; /* 120 8 */
- /* --- cacheline 2 boundary (128 bytes) --- */
- struct stack_op * stack_ops; /* 128 8 */
- struct cfi_state * cfi; /* 136 8 */
+ struct symbol * _call_dest; /* 88 8 */
+ struct reloc * _jump_table; /* 88 8 */
+ }; /* 88 8 */
+ struct alternative * alts; /* 96 8 */
+ struct symbol * sym; /* 104 8 */
+ struct stack_op * stack_ops; /* 112 8 */
+ struct cfi_state * cfi; /* 120 8 */
- /* size: 144, cachelines: 3, members: 28 */
- /* sum members: 142 */
- /* sum bitfield members: 14 bits, bit holes: 1, sum bit holes: 2 bits */
- /* last cacheline: 16 bytes */
+ /* size: 128, cachelines: 2, members: 29 */
+ /* sum members: 124 */
+ /* sum bitfield members: 22 bits, bit holes: 1, sum bit holes: 10 bits */
};
pre: 5:38.18 real, 213.25 user, 124.90 sys, 23449040 mem
post: 5:03.34 real, 210.75 user, 88.80 sys, 20241232 mem
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build only
Tested-by: Thomas Weißschuh <linux@weissschuh.net> # compile and run
Link: https://lore.kernel.org/r/20230208172245.851307606@infradead.org1 parent 6ea17e8 commit 1c34496
4 files changed
Lines changed: 133 additions & 86 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
54 | 55 | | |
55 | | - | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | | - | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
64 | | - | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
70 | | - | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| |||
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
81 | 95 | | |
82 | | - | |
| 96 | + | |
83 | 97 | | |
84 | | - | |
| 98 | + | |
85 | 99 | | |
86 | | - | |
| 100 | + | |
87 | 101 | | |
88 | 102 | | |
89 | 103 | | |
90 | 104 | | |
91 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
92 | 112 | | |
93 | 113 | | |
94 | 114 | | |
95 | 115 | | |
96 | 116 | | |
97 | 117 | | |
98 | 118 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 119 | + | |
| 120 | + | |
103 | 121 | | |
104 | 122 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
109 | 126 | | |
110 | 127 | | |
111 | 128 | | |
| |||
384 | 401 | | |
385 | 402 | | |
386 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
387 | 407 | | |
388 | 408 | | |
389 | 409 | | |
| |||
409 | 429 | | |
410 | 430 | | |
411 | 431 | | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
416 | 441 | | |
417 | | - | |
418 | | - | |
| 442 | + | |
| 443 | + | |
419 | 444 | | |
| 445 | + | |
420 | 446 | | |
421 | 447 | | |
| 448 | + | |
422 | 449 | | |
423 | 450 | | |
424 | 451 | | |
425 | 452 | | |
426 | 453 | | |
427 | | - | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
428 | 457 | | |
429 | 458 | | |
430 | 459 | | |
| |||
435 | 464 | | |
436 | 465 | | |
437 | 466 | | |
438 | | - | |
439 | 467 | | |
440 | 468 | | |
441 | 469 | | |
| 470 | + | |
| 471 | + | |
442 | 472 | | |
443 | 473 | | |
444 | 474 | | |
| |||
481 | 511 | | |
482 | 512 | | |
483 | 513 | | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | 514 | | |
489 | 515 | | |
490 | 516 | | |
| |||
599 | 625 | | |
600 | 626 | | |
601 | 627 | | |
602 | | - | |
| 628 | + | |
603 | 629 | | |
604 | 630 | | |
605 | 631 | | |
| |||
634 | 660 | | |
635 | 661 | | |
636 | 662 | | |
637 | | - | |
| 663 | + | |
638 | 664 | | |
639 | 665 | | |
640 | 666 | | |
| |||
1775 | 1801 | | |
1776 | 1802 | | |
1777 | 1803 | | |
| 1804 | + | |
1778 | 1805 | | |
1779 | 1806 | | |
1780 | 1807 | | |
| |||
1876 | 1903 | | |
1877 | 1904 | | |
1878 | 1905 | | |
1879 | | - | |
1880 | | - | |
1881 | 1906 | | |
1882 | 1907 | | |
1883 | 1908 | | |
1884 | | - | |
| 1909 | + | |
| 1910 | + | |
1885 | 1911 | | |
1886 | 1912 | | |
1887 | 1913 | | |
| |||
1931 | 1957 | | |
1932 | 1958 | | |
1933 | 1959 | | |
1934 | | - | |
| 1960 | + | |
1935 | 1961 | | |
1936 | 1962 | | |
1937 | 1963 | | |
| |||
3522 | 3548 | | |
3523 | 3549 | | |
3524 | 3550 | | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
3525 | 3556 | | |
3526 | | - | |
3527 | | - | |
| 3557 | + | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
| 3567 | + | |
3528 | 3568 | | |
3529 | 3569 | | |
| 3570 | + | |
| 3571 | + | |
| 3572 | + | |
3530 | 3573 | | |
3531 | 3574 | | |
3532 | 3575 | | |
| |||
3777 | 3820 | | |
3778 | 3821 | | |
3779 | 3822 | | |
| 3823 | + | |
| 3824 | + | |
| 3825 | + | |
| 3826 | + | |
| 3827 | + | |
| 3828 | + | |
| 3829 | + | |
| 3830 | + | |
| 3831 | + | |
| 3832 | + | |
| 3833 | + | |
| 3834 | + | |
| 3835 | + | |
| 3836 | + | |
3780 | 3837 | | |
3781 | 3838 | | |
3782 | 3839 | | |
3783 | 3840 | | |
3784 | | - | |
| 3841 | + | |
3785 | 3842 | | |
3786 | 3843 | | |
3787 | 3844 | | |
3788 | 3845 | | |
3789 | 3846 | | |
3790 | 3847 | | |
3791 | 3848 | | |
3792 | | - | |
3793 | | - | |
3794 | | - | |
| 3849 | + | |
| 3850 | + | |
3795 | 3851 | | |
3796 | | - | |
3797 | | - | |
3798 | | - | |
3799 | | - | |
3800 | | - | |
3801 | | - | |
3802 | | - | |
3803 | | - | |
3804 | | - | |
3805 | | - | |
3806 | | - | |
3807 | | - | |
| 3852 | + | |
| 3853 | + | |
3808 | 3854 | | |
3809 | 3855 | | |
3810 | 3856 | | |
| |||
4070 | 4116 | | |
4071 | 4117 | | |
4072 | 4118 | | |
4073 | | - | |
| 4119 | + | |
4074 | 4120 | | |
4075 | 4121 | | |
4076 | 4122 | | |
| |||
4102 | 4148 | | |
4103 | 4149 | | |
4104 | 4150 | | |
4105 | | - | |
| 4151 | + | |
4106 | 4152 | | |
4107 | 4153 | | |
4108 | 4154 | | |
| |||
4115 | 4161 | | |
4116 | 4162 | | |
4117 | 4163 | | |
4118 | | - | |
| 4164 | + | |
4119 | 4165 | | |
4120 | 4166 | | |
4121 | | - | |
| 4167 | + | |
4122 | 4168 | | |
4123 | 4169 | | |
4124 | 4170 | | |
| |||
4517 | 4563 | | |
4518 | 4564 | | |
4519 | 4565 | | |
4520 | | - | |
| 4566 | + | |
4521 | 4567 | | |
4522 | 4568 | | |
4523 | 4569 | | |
| |||
4626 | 4672 | | |
4627 | 4673 | | |
4628 | 4674 | | |
4629 | | - | |
| 4675 | + | |
4630 | 4676 | | |
4631 | 4677 | | |
4632 | 4678 | | |
| |||
0 commit comments