diff mbox

[5/7] kvm tools: enable LTO

Message ID 1346312203-29456-5-git-send-email-levinsasha928@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sasha Levin Aug. 30, 2012, 7:36 a.m. UTC
Build with -flto set, which should enable link-time-optimizations.

I'm not sure if it provides a significant performance increase, but
it's probably just worth it for catching issues which it may cause.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pekka Enberg Aug. 30, 2012, 8:01 a.m. UTC | #1
On Thu, Aug 30, 2012 at 10:36 AM, Sasha Levin <levinsasha928@gmail.com> wrote:
> Build with -flto set, which should enable link-time-optimizations.
>
> I'm not sure if it provides a significant performance increase, but
> it's probably just worth it for catching issues which it may cause.
>
> Signed-off-by: Sasha Levin <levinsasha928@gmail.com>

Ingo, any objections to this?

> ---
>  tools/kvm/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile
> index 8aa0125..0e2fa66 100644
> --- a/tools/kvm/Makefile
> +++ b/tools/kvm/Makefile
> @@ -243,7 +243,7 @@ DEFINES     += -DKVMTOOLS_VERSION='"$(KVMTOOLS_VERSION)"'
>  DEFINES        += -DBUILD_ARCH='"$(ARCH)"'
>
>  KVM_INCLUDE := include
> -CFLAGS += $(CPPFLAGS) $(DEFINES) -I$(KVM_INCLUDE) -I$(ARCH_INCLUDE) -I$(KINCL_PATH)/include -I$(KINCL_PATH)/arch/$(ARCH)/include/ -O2 -fno-strict-aliasing -g
> +CFLAGS += $(CPPFLAGS) $(DEFINES) -I$(KVM_INCLUDE) -I$(ARCH_INCLUDE) -I$(KINCL_PATH)/include -I$(KINCL_PATH)/arch/$(ARCH)/include/ -O2 -fno-strict-aliasing -g -flto
>
>  WARNINGS += -Wall
>  WARNINGS += -Wcast-align
> --
> 1.7.12
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ingo Molnar Aug. 30, 2012, 8:16 a.m. UTC | #2
* Pekka Enberg <penberg@kernel.org> wrote:

> On Thu, Aug 30, 2012 at 10:36 AM, Sasha Levin <levinsasha928@gmail.com> wrote:
> > Build with -flto set, which should enable link-time-optimizations.
> >
> > I'm not sure if it provides a significant performance increase, but
> > it's probably just worth it for catching issues which it may cause.
> >
> > Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
> 
> Ingo, any objections to this?

No objections if you can live with a 2x-4x increase in build 
time - at worst it might cause funnies with the BIOS linker 
script and such.

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Cyrill Gorcunov Aug. 30, 2012, 8:22 a.m. UTC | #3
On Thu, Aug 30, 2012 at 10:16:54AM +0200, Ingo Molnar wrote:
> 
> * Pekka Enberg <penberg@kernel.org> wrote:
> 
> > On Thu, Aug 30, 2012 at 10:36 AM, Sasha Levin <levinsasha928@gmail.com> wrote:
> > > Build with -flto set, which should enable link-time-optimizations.
> > >
> > > I'm not sure if it provides a significant performance increase, but
> > > it's probably just worth it for catching issues which it may cause.
> > >
> > > Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
> > 
> > Ingo, any objections to this?
> 
> No objections if you can live with a 2x-4x increase in build 
> time - at worst it might cause funnies with the BIOS linker 
> script and such.

Maybe we could enable it via some make option?
Say make LTO=1 or something?

	Cyrill
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sasha Levin Aug. 30, 2012, 8:33 a.m. UTC | #4
On 08/30/2012 10:22 AM, Cyrill Gorcunov wrote:
> On Thu, Aug 30, 2012 at 10:16:54AM +0200, Ingo Molnar wrote:
>>
>> * Pekka Enberg <penberg@kernel.org> wrote:
>>
>>> On Thu, Aug 30, 2012 at 10:36 AM, Sasha Levin <levinsasha928@gmail.com> wrote:
>>>> Build with -flto set, which should enable link-time-optimizations.
>>>>
>>>> I'm not sure if it provides a significant performance increase, but
>>>> it's probably just worth it for catching issues which it may cause.
>>>>
>>>> Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
>>>
>>> Ingo, any objections to this?
>>
>> No objections if you can live with a 2x-4x increase in build 
>> time - at worst it might cause funnies with the BIOS linker 
>> script and such.
> 
> Maybe we could enable it via some make option?
> Say make LTO=1 or something?

Build time went from 6 sec to 14, I don't think it's that significant...


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Cyrill Gorcunov Aug. 30, 2012, 8:35 a.m. UTC | #5
On Thu, Aug 30, 2012 at 10:33:21AM +0200, Sasha Levin wrote:
> >>>
> >>> Ingo, any objections to this?
> >>
> >> No objections if you can live with a 2x-4x increase in build 
> >> time - at worst it might cause funnies with the BIOS linker 
> >> script and such.
> > 
> > Maybe we could enable it via some make option?
> > Say make LTO=1 or something?
> 
> Build time went from 6 sec to 14, I don't think it's that significant...

At moment. But I bet lkvm will grow with time and build time increase
as well. Still if you think we better stick with LTO, no problem,
lets do it then ;)

	Cyrill
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pekka Enberg Aug. 30, 2012, 9:12 a.m. UTC | #6
On Thu, Aug 30, 2012 at 11:22 AM, Cyrill Gorcunov <gorcunov@openvz.org> wrote:
> Maybe we could enable it via some make option?
> Say make LTO=1 or something?

That is not going to help much in catching LTO issues early.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile
index 8aa0125..0e2fa66 100644
--- a/tools/kvm/Makefile
+++ b/tools/kvm/Makefile
@@ -243,7 +243,7 @@  DEFINES	+= -DKVMTOOLS_VERSION='"$(KVMTOOLS_VERSION)"'
 DEFINES	+= -DBUILD_ARCH='"$(ARCH)"'
 
 KVM_INCLUDE := include
-CFLAGS	+= $(CPPFLAGS) $(DEFINES) -I$(KVM_INCLUDE) -I$(ARCH_INCLUDE) -I$(KINCL_PATH)/include -I$(KINCL_PATH)/arch/$(ARCH)/include/ -O2 -fno-strict-aliasing -g
+CFLAGS	+= $(CPPFLAGS) $(DEFINES) -I$(KVM_INCLUDE) -I$(ARCH_INCLUDE) -I$(KINCL_PATH)/include -I$(KINCL_PATH)/arch/$(ARCH)/include/ -O2 -fno-strict-aliasing -g -flto
 
 WARNINGS += -Wall
 WARNINGS += -Wcast-align