qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/3] configure: add option to disable -fstack-pr


From: Noonan, Steven
Subject: Re: [Qemu-devel] [PATCH 1/3] configure: add option to disable -fstack-protector flags
Date: Fri, 10 Jan 2014 18:36:22 -0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Jan 09, 2014 at 06:18:07PM -0500, Brad Smith wrote:
> On 09/01/14 5:40 PM, Paolo Bonzini wrote:
> >Il 09/01/2014 22:55, Steven Noonan ha scritto:
> >>From: Steven Noonan <address@hidden>
> >>
> >>The -fstack-protector flag family is useful for ensuring safety and for
> >>debugging, but has a performance impact. Here's a boot time comparison 
> >>between
> >>a QEMU build of qemu-system-arm with and without the -fstack-protector-all
> >>flag:
> >>
> >>     # WITHOUT -fstack-protector-all
> >>     address@hidden ~]# systemd-analyze
> >>     Startup finished in 1.744s (kernel) + 11.345s (initrd) + 47.164s 
> >> (userspace) = 1min 255ms
> >>
> >>     # WITH -fstack-protector-all
> >>     address@hidden ~]# systemd-analyze
> >>     Startup finished in 1.843s (kernel) + 12.262s (initrd) + 1min 3.480s 
> >> (userspace) = 1min 17.587s
> >
> >Can you try -fstack-protector-strong?
> >
> >Probably the right thing to do is to pick in order
> >-fstack-protector-strong, -fstack-protector, and nothing.
> 
> +1
> 

OK, in order to get -fstack-protector-strong I had to get a Fedora box
up and running, so the compiler and build/execution environment are
different. I took three samples from each build, applying a clean 
QCOW2 snapshot before each run to avoid cross-boot confounding
variables:

    # -fstack-protector-all
    Startup finished in 1.810s (kernel) + 12.331s (initrd) + 49.016s 
(userspace) = 1min 3.159s
    Startup finished in 1.801s (kernel) + 12.287s (initrd) + 47.925s 
(userspace) = 1min 2.013s
    Startup finished in 1.812s (kernel) + 12.302s (initrd) + 47.995s 
(userspace) = 1min 2.111s
 
    # -fstack-protector-strong
    Startup finished in 1.744s (kernel) + 11.223s (initrd) + 44.688s 
(userspace) = 57.657s
    Startup finished in 1.721s (kernel) + 11.222s (initrd) + 44.194s 
(userspace) = 57.138s
    Startup finished in 1.693s (kernel) + 11.250s (initrd) + 44.426s 
(userspace) = 57.370s
    
    # -fstack-protector
    Startup finished in 1.705s (kernel) + 11.409s (initrd) + 43.563s 
(userspace) = 56.677s
    Startup finished in 1.877s (kernel) + 11.137s (initrd) + 43.719s 
(userspace) = 56.734s
    Startup finished in 1.708s (kernel) + 11.141s (initrd) + 43.628s 
(userspace) = 56.478s
    
    # no stack protector
    Startup finished in 1.743s (kernel) + 11.190s (initrd) + 43.709s 
(userspace) = 56.643s
    Startup finished in 1.763s (kernel) + 11.216s (initrd) + 43.767s 
(userspace) = 56.747s
    Startup finished in 1.711s (kernel) + 11.283s (initrd) + 43.878s 
(userspace) = 56.873s

There are a few points to note:

  - stack-protector-all doesn't cost nearly as much in this build, for
        reasons unclear to me. It looks like the kernel/initrd timings are
        rather closely reproduced, but the userspace timing varies quite a
        bit.

  - stack-protector-strong's performance hit is indeed much less than
        stack-protector-all.

  - The builds with the plain old -fstack-protector flag and without any
        stack protector are tied for the lead in terms of performance.

Amended patch attached.

Attachment: 0001-configure-add-option-to-disable-fstack-protector-fla.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]