public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Baron <jbaron@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH 5/7] x86/jump labels: Use etiher 5 byte or 2 byte jumps
Date: Mon, 12 Mar 2012 12:17:43 -0400	[thread overview]
Message-ID: <20120312161743.GB2607@redhat.com> (raw)
In-Reply-To: <20120308222202.525768259@goodmis.org>

On Thu, Mar 08, 2012 at 05:17:35PM -0500, Steven Rostedt wrote:
> From: Steven Rostedt <srostedt@redhat.com>
> 
> Have the jump labels add a "jmp" in the assembly instead
> of a default nop. This will cause the assembler to put in
> either a 2 byte or 5 byte jmp depending on where the target
> lable is.
> 
> Then at compile time, the update_jump_label code will replace
> the jmps with either 2 or 5 byte nops.
> 
> On boot up, the code can be examined to see if the jump label
> uses either a 2 or 5 byte nop and replace it.
> 
> By allowing the jump labels to be 2 bytes, it speeds up the
> nops, not only 2 byte nops are faster than 5 byte nops, but also
> because it saves on cache foot print.
> 
>    text    data     bss     dec     hex filename
> 13403667 3666856 2998272 20068795 13239bb ../nobackup/mxtest/vmlinux-old
> 13398536 3666856 2998272 20063664 13225b0 ../nobackup/mxtest/vmlinux-new
> 
> Converting the current v3.2 trace points saved 5,131 bytes.
> As more places use jump labels, this will have a bigger savings.
> 

Hi Steven,

Strange. I'm not seeing the text size savings with this patch, relative
to the 'old' jump label compiled code. Is your comparison against jump
labels disabled?

Here's the size without your patch 'CONFIG_JUMP_LABEL' set:

   text    data     bss     dec     hex filename
10809465        1023976 1159168 12992609         c64061 vmlinux

And with your patches and 'CONFIG_JUMP_LABEL' set:

   text    data     bss     dec     hex filename
10812613        1023976 1163264 12999853         c65cad vmlinux

So an increase in text of 3148. Which is not completely explained by the
increase in arch/x86/kernel/jump_label.o:

without your patch 'CONFIG_JUMP_LABEL' set:

   text    data     bss     dec     hex filename
    229       0       0     229      e5 arch/x86/kernel/jump_label.o


with your patch 'CONFIG_JUMP_LABEL' set:

   text    data     bss     dec     hex filename
    943       0       8     951     3b7 arch/x86/kernel/jump_label.o

So jump_label.o is 714 bytes larger, which is not enough to explain the
3148 byte increase.

I'm using gcc (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1).

Can you please double check the savings.

Thanks,

-Jason

  reply	other threads:[~2012-03-12 16:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08 22:17 [PATCH 0/7] [GIT PULL] jump-labels: Implement 2 and 5 byte jumps Steven Rostedt
2012-03-08 22:17 ` [PATCH 1/7] x86/jump-label: Use best default nops for inital jump label calls Steven Rostedt
2012-03-08 22:17 ` [PATCH 2/7] x86/jump-label: Do not bother updating nops if they are correct Steven Rostedt
2012-03-08 22:17 ` [PATCH 3/7] x86/jump-label: Add safety checks to jump label conversions Steven Rostedt
2012-03-08 22:17 ` [PATCH 4/7] jump labels: Add infrastructure to update jump labels at compile time Steven Rostedt
2012-03-08 22:17 ` [PATCH 5/7] x86/jump labels: Use etiher 5 byte or 2 byte jumps Steven Rostedt
2012-03-12 16:17   ` Jason Baron [this message]
2012-03-12 16:29     ` Steven Rostedt
2012-03-12 17:27     ` Steven Rostedt
2012-03-12 18:03       ` Jason Baron
2012-03-08 22:17 ` [PATCH 6/7] x86/jump lables: Show where and what was wrong on errors Steven Rostedt
2012-03-08 22:17 ` [PATCH 7/7] x86/jump labels: Handle initialization of enabled nops Steven Rostedt

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=20120312161743.GB2607@redhat.com \
    --to=jbaron@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.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