Re: [PATCH 2/2] fs: optimize mpage_bio_submit()

From: Changli Gao
Date: Sat May 29 2010 - 09:33:28 EST


On Sat, May 29, 2010 at 8:47 PM, Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> ok, can you sincerely tell me that your change makes the code more
> readable? And have you checked to see what the compiler actually
> "optimizes"?
>
> original code:
>
>    Âmovq  Â$mpage_end_io_read, %rdx    Â#, tmp65
>    Âmovq  Â$mpage_end_io_write, %rax    #, tmp64
>    Âcmpl  Â$1, %edi    Â#, rw
>    Âcmovne Â%rdx, %rax   Â# tmp65,, tmp64
>    Âmovq  Â%rax, 80(%rsi) Â# tmp64, <variable>.bi_end_io
> Â Â Â Â.loc 1 91 0
>    Âcall  Âsubmit_bio   Â#
>
> your change:
>
>    Âmovq  Â$mpage_end_io_read, %rdx    Â#, tmp63
>    Âmovq  Â$mpage_end_io_write, %rax    #, iftmp.561
>    Âcmpl  Â$1, %edi    Â#, rw
>    Âcmovne Â%rdx, %rax   Â# tmp63,, iftmp.561
>    Âmovq  Â%rax, 80(%rsi) Â# iftmp.561, <variable>.bi_end_io
> Â Â Â Â.loc 1 90 0
>    Âcall  Âsubmit_bio   Â#
>
> so that change does nothing except obfuscating the source a bit more so
> that you get more headaches whenever you look at it.
>

Oh, I didn't check the asm code. Compiler is smarter than I thought.
Thanks for your explaining.


--
Regardsï
Changli Gao(xiaosuo@xxxxxxxxx)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/