Re: [PATCH] net: force inlining of netif_tx_start/stop_queue, sock_hold, __sock_put
From: David Miller
Date: Wed Apr 13 2016 - 22:43:13 EST
From: Denys Vlasenko <dvlasenk@xxxxxxxxxx>
Date: Fri, 8 Apr 2016 17:51:54 +0200
> 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.
...
> 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@xxxxxxxxxx>
Applied to net-next, thanks.