linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] direct-io: Deinline dio_zero_block, save 2684 bytes
@ 2016-03-13 21:36 Denys Vlasenko
  2016-03-14  1:07 ` Ming Lei
  0 siblings, 1 reply; 4+ messages in thread
From: Denys Vlasenko @ 2016-03-13 21:36 UTC (permalink / raw)
  To: Denys Vlasenko
  Cc: Al Viro, Jens Axboe, Christoph Hellwig, Linux Kernel Mailing List

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] direct-io: Deinline dio_zero_block, save 2684 bytes
  2016-03-13 21:36 [PATCH] direct-io: Deinline dio_zero_block, save 2684 bytes Denys Vlasenko
@ 2016-03-14  1:07 ` Ming Lei
  0 siblings, 0 replies; 4+ messages in thread
From: Ming Lei @ 2016-03-14  1:07 UTC (permalink / raw)
  To: Denys Vlasenko
  Cc: Denys Vlasenko, Al Viro, Jens Axboe, Christoph Hellwig,
	Linux Kernel Mailing List

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] direct-io: Deinline dio_zero_block, save 2684 bytes
  2016-03-13 21:00 ` [PATCH] direct-io: Deinline dio_zero_block, save 2684 bytes Denys Vlasenko
@ 2016-03-14 14:37   ` Jeff Moyer
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Moyer @ 2016-03-14 14:37 UTC (permalink / raw)
  To: Denys Vlasenko; +Cc: Al Viro, Jens Axboe, Christoph Hellwig, linux-kernel

Denys Vlasenko <dvlasenk@redhat.com> writes:

> 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

NAK

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] direct-io: Deinline dio_zero_block, save 2684 bytes
  2016-03-13 21:00 [PATCH] direct-io: Deinline submit_page_section, save 5304 bytes Denys Vlasenko
@ 2016-03-13 21:00 ` Denys Vlasenko
  2016-03-14 14:37   ` Jeff Moyer
  0 siblings, 1 reply; 4+ messages in thread
From: Denys Vlasenko @ 2016-03-13 21:00 UTC (permalink / raw)
  To: Al Viro; +Cc: Denys Vlasenko, Jens Axboe, Christoph Hellwig, linux-kernel

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

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: Al Viro <viro@zeniv.linux.org.uk>
CC: Jens Axboe <axboe@fb.com>
CC: Christoph Hellwig <hch@lst.de>
CC: linux-kernel@vger.kernel.org
---
 fs/direct-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/direct-io.c b/fs/direct-io.c
index 21ec685..729c902 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -857,7 +857,7 @@ static void clean_blockdev_aliases(struct dio *dio, struct buffer_head *map_bh)
  * `end' is zero if we're doing the start of the IO, 1 at the end of the
  * IO.
  */
-static inline void dio_zero_block(struct dio *dio, struct dio_submit *sdio,
+static void dio_zero_block(struct dio *dio, struct dio_submit *sdio,
 		int end, struct buffer_head *map_bh)
 {
 	unsigned dio_blocks_per_fs_block;
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-14 14:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-13 21:36 [PATCH] direct-io: Deinline dio_zero_block, save 2684 bytes Denys Vlasenko
2016-03-14  1:07 ` Ming Lei
  -- strict thread matches above, loose matches on Subject: below --
2016-03-13 21:00 [PATCH] direct-io: Deinline submit_page_section, save 5304 bytes Denys Vlasenko
2016-03-13 21:00 ` [PATCH] direct-io: Deinline dio_zero_block, save 2684 bytes Denys Vlasenko
2016-03-14 14:37   ` Jeff Moyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).