Denys Vlasenko
f9a7cbbf18
net: force inlining of netif_tx_start/stop_queue, sock_hold, __sock_put
Sometimes gcc mysteriously doesn't inline
very small functions we expect to be inlined. See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66122
Arguably, gcc should do better, but gcc people aren't willing
to invest time into it, asking to use __always_inline instead.
With this .config:
http://busybox.net/~vda/kernel_config_OPTIMIZE_INLINING_and_Os,
the following functions get deinlined many times.
netif_tx_stop_queue: 207 copies, 590 calls:
55 push %rbp
48 89 e5 mov %rsp,%rbp
f0 80 8f e0 01 00 00 01 lock orb $0x1,0x1e0(%rdi)
5d pop %rbp
c3 retq
netif_tx_start_queue: 47 copies, 111 calls
55 push %rbp
48 89 e5 mov %rsp,%rbp
f0 80 a7 e0 01 00 00 fe lock andb $0xfe,0x1e0(%rdi)
5d pop %rbp
c3 retq
sock_hold: 39 copies, 124 calls
55 push %rbp
48 89 e5 mov %rsp,%rbp
f0 ff 87 80 00 00 00 lock incl 0x80(%rdi)
5d pop %rbp
c3 retq
__sock_put: 6 copies, 13 calls
55 push %rbp
48 89 e5 mov %rsp,%rbp
f0 ff 8f 80 00 00 00 lock decl 0x80(%rdi)
5d pop %rbp
c3 retq
This patch fixes this via s/inline/__always_inline/.
Code size decrease after the patch is ~2.5k:
text data bss dec hex filename
56719876 56364551 36196352 149280779 8e5d80b vmlinux_before
56717440 56364551 36196352 149278343 8e5ce87 vmlinux
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: David S. Miller <davem@davemloft.net>
CC: linux-kernel@vger.kernel.org
CC: netdev@vger.kernel.org
CC: netfilter-devel@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-04-13 22:40:54 -04:00
..
2016-04-04 10:41:08 -07:00
2016-03-23 06:06:45 -07:00
2016-03-21 14:35:52 -07:00
2016-03-19 10:05:34 -07:00
2016-03-22 15:48:44 -07:00
2016-03-28 17:57:45 +02:00
2016-03-24 19:57:15 -07:00
2016-03-17 12:50:55 -07:00
2016-03-17 15:09:34 -07:00
2016-03-23 06:09:15 -07:00
2016-03-17 21:51:52 -07:00
2016-04-04 10:41:08 -07:00
2016-03-17 15:09:34 -07:00
2016-03-29 11:52:11 +02:00
2016-03-15 16:55:16 -07:00
2016-03-15 16:55:16 -07:00
2016-04-04 10:41:08 -07:00
2016-04-04 10:41:08 -07:00
2016-03-20 09:34:02 -06:00
2016-04-04 10:41:08 -07:00
2016-04-07 21:04:26 -04:00
2016-03-25 11:37:57 -04:00
2016-04-04 10:41:08 -07:00
2016-03-22 15:36:02 -07:00
2016-03-16 13:31:46 -07:00
2016-03-17 15:09:34 -07:00
2016-03-22 15:36:02 -07:00
2016-04-05 14:19:08 +02:00
2016-03-15 09:01:06 +01:00
2016-03-25 19:10:03 +01:00
2016-03-22 15:36:02 -07:00
2016-03-22 15:36:02 -07:00
2016-03-26 16:14:37 -04:00
2016-03-23 06:06:45 -07:00
2016-03-19 11:03:49 +01:00
2016-03-20 13:28:18 -07:00
2016-03-14 11:18:12 +05:30
2016-03-20 18:58:18 -07:00
2016-04-04 10:41:08 -07:00
2016-03-15 16:55:16 -07:00
2016-03-25 08:48:31 -07:00
2016-04-07 16:44:14 -04:00
2016-03-17 15:09:34 -07:00
2016-04-07 17:22:20 -07:00
2016-03-21 11:03:02 -07:00
2016-03-19 18:52:29 -07:00
2016-03-14 00:17:28 -04:00
2016-03-25 16:37:42 -07:00
2016-03-17 15:09:34 -07:00
2016-03-17 15:09:34 -07:00
2016-04-01 17:03:37 -05:00
2016-04-06 13:18:19 +02:00
2016-03-25 16:37:42 -07:00
2016-03-22 15:36:02 -07:00
2016-04-05 13:25:12 +02:00
2016-03-16 17:45:56 -07:00
2016-03-15 12:48:48 -07:00
2016-03-17 22:13:41 -07:00
2016-03-14 10:30:57 -04:00
2016-03-25 16:37:42 -07:00
2016-03-22 15:36:02 -07:00
2016-03-24 10:52:25 -07:00
2016-03-22 15:36:02 -07:00
2016-03-14 09:22:20 +01:00
2016-03-18 18:10:38 -07:00
2016-03-17 15:09:34 -07:00
2016-03-17 09:45:10 +01:00
2016-03-14 12:19:46 -04:00
2016-04-11 21:15:48 -04:00
2016-03-17 15:09:34 -07:00
2016-03-15 16:55:16 -07:00
2016-03-17 13:47:50 -07:00
2016-03-15 16:55:16 -07:00
2016-03-20 16:47:13 -04:00
2016-04-04 10:41:08 -07:00
2016-04-04 10:41:08 -07:00
2016-03-15 16:55:16 -07:00
2016-03-17 15:09:34 -07:00
2016-04-13 22:40:54 -04:00
2016-03-17 14:57:16 -04:00
2016-04-04 10:41:08 -07:00
2016-04-04 10:41:08 -07:00
2016-03-23 12:34:17 +01:00
2016-03-21 19:30:06 -04:00
2016-03-19 15:15:07 -07:00
2016-03-25 16:37:42 -07:00
2016-03-15 16:55:16 -07:00
2016-03-15 16:55:16 -07:00
2016-03-17 15:09:34 -07:00
2016-03-17 15:09:34 -07:00
2016-03-17 15:09:34 -07:00
2016-04-04 10:41:08 -07:00
2016-03-15 08:52:28 -05:00
2016-03-19 15:38:41 -07:00
2016-04-07 21:04:26 -04:00
2016-03-14 15:43:11 -04:00
2016-03-17 02:32:04 +01:00
2016-03-28 17:19:31 -07:00
2016-03-15 16:55:16 -07:00
2016-03-17 15:09:34 -07:00
2016-03-17 15:09:34 -07:00
2016-03-17 15:09:34 -07:00
2016-03-15 13:50:29 -07:00
2016-04-05 10:56:32 +02:00
2016-03-22 15:36:02 -07:00
2016-03-22 15:36:02 -07:00
2016-03-22 15:36:02 -07:00
2016-03-22 15:36:02 -07:00
2016-03-17 15:09:34 -07:00
2016-03-14 17:08:15 +01:00
2016-03-29 11:52:11 +02:00
2016-04-05 16:29:37 -04:00
2016-03-25 16:37:42 -07:00
2016-03-25 16:37:42 -07:00
2016-03-25 16:37:42 -07:00
2016-03-25 16:37:42 -07:00
2016-04-02 20:23:09 -04:00
2016-03-17 15:09:34 -07:00
2016-04-04 10:41:08 -07:00
2016-03-14 14:55:26 -04:00
2016-03-18 14:10:57 +08:00
2016-03-17 15:09:34 -07:00
2016-04-07 21:04:26 -04:00
2016-03-15 16:55:16 -07:00
2016-04-07 16:53:29 -04:00
2016-03-17 15:09:34 -07:00
2016-03-16 21:11:19 +01:00