public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>, Dave Jones <davej@redhat.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	esandeen@redhat.com, cebbert@redhat.com,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: Unnecessary overhead with stack protector.
Date: Wed, 21 Oct 2009 14:09:31 -0500	[thread overview]
Message-ID: <4ADF5C6B.80605@redhat.com> (raw)
In-Reply-To: <4ADF59F8.7010205@redhat.com>

Eric Sandeen wrote:
> Arjan van de Ven wrote:

...

>> do you have any indication that SP actually increases the stack
>> footprint by that much? it's only a few bytes....
>>
>>
> 
> Here's a sample of some of the largest xfs stack users,
> and the effect stack-protector had on them.  This was just
> done with objdump -d xfs.ko | scripts/checkstack.pl; I don't
> know if there's extra runtime stack overhead w/ stackprotector?
> 
> -Eric
> 
> function                  nostack stackprot delta delta %
> xfs_bmapi                      376      408    32  9%
> xfs_bulkstat                   328      344    16  5%
> _xfs_trans_commit              296      312    16  5%
> xfs_iomap_write_delay          264      280    16  6%
> xfs_file_ioctl                 248      312    64 26%
> xfs_symlink                    248      264    16  6%
> xfs_bunmapi                    232      280    48 21%
> xlog_do_recovery_pass          232      248    16  7%
> xfs_trans_unreserve_and_mod_sb 224      240    16  7%
> xfs_bmap_del_extent            216      248    32 15%
> xfs_cluster_write              216      232    16  7%
> xfs_file_compat_ioctl          216      296    80 37%
> xfs_attr_set_int               200      216    16  8%
> xfs_bmap_add_extent_delay_real 200      248    48 24%
> 

but maybe more to Dave's original point, xfs on x86_64 in my tree had
243 functions with minimal stack usage of 8 bytes.  w/
CC_STACKPROTECTOR_ALL in force, I end up with these sizes for those
functions:

  count bytes
      3 16
    236 24
      1 32
      5 40

8->24 bytes is pretty significant too, w/ a 200% increase, if you add a
few up...

-Eric

  reply	other threads:[~2009-10-21 19:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-15 18:35 Unnecessary overhead with stack protector Dave Jones
2009-10-15 19:07 ` Ingo Molnar
2009-10-21 15:50   ` Eric Sandeen
2009-10-21 18:00     ` Arjan van de Ven
2009-10-21 18:59       ` Eric Sandeen
2009-10-21 19:09         ` Eric Sandeen [this message]
2009-10-21 19:24           ` Eric Sandeen
2009-10-21 21:08             ` Chuck Ebbert
2009-10-21 19:16         ` XFS stack overhead Ingo Molnar
2009-10-21 19:21           ` Eric Sandeen
2009-10-21 20:22             ` Chuck Ebbert
2009-10-22  1:26 ` Unnecessary overhead with stack protector Andrew Morton
2009-10-26 16:30   ` Chuck Ebbert
2009-10-26 16:37     ` Andrew Morton
2009-10-26 16:56       ` Chuck Ebbert
2009-10-26 20:03         ` Ingo Molnar

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=4ADF5C6B.80605@redhat.com \
    --to=sandeen@redhat.com \
    --cc=arjan@infradead.org \
    --cc=cebbert@redhat.com \
    --cc=davej@redhat.com \
    --cc=esandeen@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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