Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1356754 > unrolled thread

Re: [PATCH] direct-io: Deinline dio_zero_block, save 2684 bytes

Started byDenys Vlasenko <vda.linux@googlemail.com>
First post2016-03-13 22:40 +0100
Last post2016-03-14 02:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  Re: [PATCH] direct-io: Deinline dio_zero_block, save 2684 bytes Denys Vlasenko <vda.linux@googlemail.com> - 2016-03-13 22:40 +0100
    Re: [PATCH] direct-io: Deinline dio_zero_block, save 2684 bytes Ming Lei <tom.leiming@gmail.com> - 2016-03-14 02:10 +0100

#1356754 — Re: [PATCH] direct-io: Deinline dio_zero_block, save 2684 bytes

FromDenys Vlasenko <vda.linux@googlemail.com>
Date2016-03-13 22:40 +0100
SubjectRe: [PATCH] direct-io: Deinline dio_zero_block, save 2684 bytes
Message-ID<rclTY-2N8-17@gated-at.bofh.it>
On Sun, Mar 13, 2016 at 10:00 PM, Denys Vlasenko <dvlasenk@redhat.com> wrote:
> This function compiles to 2684 bytes, 2 callsites
>
>    text    data     bss     dec     hex filename
>    9655      16       0    9671    25c7 direct-io.o.before2
>    9559      16       0    9575    2567 direct-io.o

Al, you undoubtedly noticed the discrepancy between
"save 2684 bytes" claim in the commit description
and the above data, which shows no such thing.

Sorry, I was too quick to send the mail to notice it :(

Further investigation had shown that it's my particular version of gcc
deciding to deinline the function even before the patch.
Other version of gcc, on a different machine was running
large inlining search script, did not do that, and saw the 2684 bytes
of savings.

tl;dr: the patch is correct, my "size" printout wasn't.

[toc] | [next] | [standalone]


#1356795

FromMing Lei <tom.leiming@gmail.com>
Date2016-03-14 02:10 +0100
Message-ID<rcpbc-51v-5@gated-at.bofh.it>
In reply to#1356754
On Mon, Mar 14, 2016 at 5:36 AM, Denys Vlasenko
<vda.linux@googlemail.com> wrote:
> On Sun, Mar 13, 2016 at 10:00 PM, Denys Vlasenko <dvlasenk@redhat.com> wrote:
>> This function compiles to 2684 bytes, 2 callsites
>>
>>    text    data     bss     dec     hex filename
>>    9655      16       0    9671    25c7 direct-io.o.before2
>>    9559      16       0    9575    2567 direct-io.o
>
> Al, you undoubtedly noticed the discrepancy between
> "save 2684 bytes" claim in the commit description
> and the above data, which shows no such thing.
>
> Sorry, I was too quick to send the mail to notice it :(
>
> Further investigation had shown that it's my particular version of gcc
> deciding to deinline the function even before the patch.
> Other version of gcc, on a different machine was running
> large inlining search script, did not do that, and saw the 2684 bytes
> of savings.
>
> tl;dr: the patch is correct, my "size" printout wasn't.

Not sure the patch is correct, please see the commit for
do_blockdev_direct_IO():

 * NOTE: if you pass "sdio" to anything by pointer make sure that function
 * is always inlined. Otherwise gcc is unable to split the structure into
 * individual fields and will generate much worse code. This is important
 * for the whole file.



thanks,
Ming Lei

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web