linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yafang Shao <laoar.shao@gmail.com>
To: willy@infradead.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	darrick.wong@oracle.com, Linux MM <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/filemap.c: minor optimization in write_iter file operation
Date: Sun, 18 Nov 2018 23:02:19 +0800	[thread overview]
Message-ID: <CALOAHbAfWkAYJPTRfyPmHKSmg7UEhtnamzUVx9xd4oYkqi_x8g@mail.gmail.com> (raw)
In-Reply-To: <20181118121318.GC7861@bombadil.infradead.org>

On Sun, Nov 18, 2018 at 8:13 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Sun, Nov 18, 2018 at 08:02:18PM +0800, Yafang Shao wrote:
> > This little adjustment on bitwise operation could make the code a little
> > faster.
> > As write_iter is used in lots of critical path, so this code change is
> > useful for performance.
>
> Did you check the before/after code generation with this patch applied?
>

Yes, I did.
My oompiler is gcc-4.8.5, a litte old, and with CONFIG_CC_OPTIMIZE_FOR_SIZE on.
The output file is differrent.

> $ diff -u before.S after.S
> --- before.S    2018-11-18 07:11:48.031096768 -0500
> +++ after.S     2018-11-18 07:11:36.883069103 -0500
> @@ -1,5 +1,5 @@
>
> -before.o:     file format elf32-i386
> +after.o:     file format elf32-i386
>
>
>  Disassembly of section .text:
>
> with gcc 8.2.0, I see no difference, indicating that the compiler already
> makes this optimisation.

Could pls. try set CONFIG_CC_OPTIMIZE_FOR_SIZE on and then compare them again ?

Thanks
Yafang

  reply	other threads:[~2018-11-18 15:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-18 12:02 Yafang Shao
2018-11-18 12:13 ` Matthew Wilcox
2018-11-18 15:02   ` Yafang Shao [this message]
2018-11-19  1:03     ` Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALOAHbAfWkAYJPTRfyPmHKSmg7UEhtnamzUVx9xd4oYkqi_x8g@mail.gmail.com \
    --to=laoar.shao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=darrick.wong@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox