Re: [PATCH] mm/filemap.c: minor optimization in write_iter file operation

From: Matthew Wilcox
Date: Sun Nov 18 2018 - 20:03:04 EST


On Sun, Nov 18, 2018 at 11:02:19PM +0800, Yafang Shao wrote:
> On Sun, Nov 18, 2018 at 8:13 PM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
> > 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.
> > 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 ?

Actually it was already on:

# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y

I happened to build it in my build-tiny output tree.