The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Andrew Haley <aph@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	feng.tang@intel.com, Fr??d??ric Weisbecker <fweisbec@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Peter Zijlstra <peterz@infradead.org>,
	jakub@redhat.com, gcc@gcc.gnu.org
Subject: Re: BUG: GCC-4.4.x changes the function frame on some functions
Date: Thu, 19 Nov 2009 17:43:45 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.0911191720030.24119@localhost.localdomain> (raw)
In-Reply-To: <4B056FAD.2080500@redhat.com>

On Thu, 19 Nov 2009, Andrew Haley wrote:

> Thomas Gleixner wrote:
> > On Thu, 19 Nov 2009, Andrew Haley wrote:
> >> Thomas Gleixner wrote:
> >>> There is no real obvious reason why the edi magic needs to be done
> >>> _before_ 
> >>>
> >>> 	push   %ebp
> >>> 	mov    %esp,%ebp
> >> Sure there is: unless you do the adjustment first %ebp won't be 16-aligned.
> > 
> > And why is this not done in 99% of the functions in the kernel, just
> > in this one and some random others ?
> 
> If I could see the function I might be able to tell you.  It's either a
> performance enhancement, something to do with SSE, or it's a bug.

kernel/time/timer_stats.c timer_stats_update_stats()

Here is the disassembly:

8107ad50 <timer_stats_update_stats>:
8107ad50:	57                   	push   %edi
8107ad51:	8d 7c 24 08          	lea    0x8(%esp),%edi
8107ad55:	83 e4 f0             	and    $0xfffffff0,%esp
8107ad58:	ff 77 fc             	pushl  -0x4(%edi)
8107ad5b:	55                   	push   %ebp
8107ad5c:	89 e5                	mov    %esp,%ebp
8107ad5e:	57                   	push   %edi
8107ad5f:	56                   	push   %esi
8107ad60:	53                   	push   %ebx
8107ad61:	83 ec 6c             	sub    $0x6c,%esp
8107ad64:	e8 47 92 f8 ff       	call   81003fb0 <mcount>
8107ad69:	8b 77 04             	mov    0x4(%edi),%esi
8107ad6c:	89 75 a4             	mov    %esi,-0x5c(%ebp)
8107ad6f:	65 8b 35 14 00 00 00 	mov    %gs:0x14,%esi
8107ad76:	89 75 e4             	mov    %esi,-0x1c(%ebp)
8107ad79:	31 f6                	xor    %esi,%esi
8107ad7b:	8b 35 60 5a cd 81    	mov    0x81cd5a60,%esi
8107ad81:	8b 1f                	mov    (%edi),%ebx
8107ad83:	85 f6                	test   %esi,%esi
8107ad85:	8b 7f 08             	mov    0x8(%edi),%edi
8107ad88:	75 18                	jne    8107ada2 <timer_stats_update_stats+0x52>
8107ad8a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
8107ad8d:	65 33 05 14 00 00 00 	xor    %gs:0x14,%eax
8107ad94:	75 53                	jne    8107ade9 <timer_stats_update_stats+0x99>
8107ad96:	83 c4 6c             	add    $0x6c,%esp
8107ad99:	5b                   	pop    %ebx
8107ad9a:	5e                   	pop    %esi
8107ad9b:	5f                   	pop    %edi
8107ad9c:	5d                   	pop    %ebp
8107ad9d:	8d 67 f8             	lea    -0x8(%edi),%esp
8107ada0:	5f                   	pop    %edi
8107ada1:	c3                   	ret    
8107ada2:	be 00 7a d6 81       	mov    $0x81d67a00,%esi
8107ada7:	89 45 ac             	mov    %eax,-0x54(%ebp)
8107adaa:	89 75 a0             	mov    %esi,-0x60(%ebp)
8107adad:	89 5d b4             	mov    %ebx,-0x4c(%ebp)
8107adb0:	64 8b 35 78 6a d6 81 	mov    %fs:0x81d66a78,%esi
8107adb7:	8b 34 b5 20 50 cd 81 	mov    -0x7e32afe0(,%esi,4),%esi
8107adbe:	89 4d b0             	mov    %ecx,-0x50(%ebp)
8107adc1:	01 75 a0             	add    %esi,-0x60(%ebp)
8107adc4:	89 55 b8             	mov    %edx,-0x48(%ebp)
8107adc7:	8b 45 a0             	mov    -0x60(%ebp),%eax
8107adca:	89 7d c0             	mov    %edi,-0x40(%ebp)
8107adcd:	e8 de f7 76 00       	call   817ea5b0 <_spin_lock_irqsave>
8107add2:	83 3d 60 5a cd 81 00 	cmpl   $0x0,0x81cd5a60
8107add9:	89 c3                	mov    %eax,%ebx
8107addb:	75 11                	jne    8107adee <timer_stats_update_stats+0x9e>
8107addd:	89 da                	mov    %ebx,%edx
8107addf:	8b 45 a0             	mov    -0x60(%ebp),%eax
8107ade2:	e8 79 fc 76 00       	call   817eaa60 <_spin_unlock_irqrestore>
8107ade7:	eb a1                	jmp    8107ad8a <timer_stats_update_stats+0x3a>
8107ade9:	e8 52 e4 fc ff       	call   81049240 <__stack_chk_fail>
8107adee:	8d 45 a8             	lea    -0x58(%ebp),%eax
8107adf1:	8b 55 a4             	mov    -0x5c(%ebp),%edx
8107adf4:	e8 f7 fd ff ff       	call   8107abf0 <tstat_lookup>
8107adf9:	85 c0                	test   %eax,%eax
8107adfb:	74 05                	je     8107ae02 <timer_stats_update_stats+0xb2>
8107adfd:	ff 40 14             	incl   0x14(%eax)
8107ae00:	eb db                	jmp    8107addd <timer_stats_update_stats+0x8d>
8107ae02:	f0 ff 05 00 67 fd 81 	lock incl 0x81fd6700
8107ae09:	eb d2                	jmp    8107addd <timer_stats_update_stats+0x8d>
8107ae0b:	90                   	nop
8107ae0c:	90                   	nop
8107ae0d:	90                   	nop
8107ae0e:	90                   	nop
8107ae0f:	90                   	nop


There is a dozen more of those.

Thanks,

	tglx

  reply	other threads:[~2009-11-19 16:45 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200911172214.nAHMEBh2023787@imap1.linux-foundation.org>
2009-11-18 19:30 ` [patch for 2.6.32? 1/3] hrtimers: remove the "timer_stats_active" check when setting the start info Thomas Gleixner
2009-11-18 20:24   ` [tip:timers/urgent] hrtimer: Fix /proc/timer_list regression tip-bot for Feng Tang
2009-11-19  7:20     ` Ingo Molnar
2009-11-19 10:05       ` Thomas Gleixner
2009-11-19 14:30         ` BUG: function graph tracer function frame assumptions Thomas Gleixner
2009-11-19 15:37           ` BUG: GCC-4.4.x changes the function frame on some functions Thomas Gleixner
2009-11-19 15:44             ` Andrew Haley
2009-11-19 15:54               ` H. Peter Anvin
2009-11-19 15:57                 ` Richard Guenther
2009-11-19 16:02               ` Steven Rostedt
2009-11-19 16:11                 ` H. Peter Anvin
2009-11-19 16:19                 ` Frederic Weisbecker
2009-11-19 16:06               ` Thomas Gleixner
2009-11-19 16:17                 ` Andrew Haley
2009-11-19 16:43                   ` Thomas Gleixner [this message]
2009-11-19 16:12               ` Steven Rostedt
2009-11-19 15:45             ` H. Peter Anvin
2009-11-19 15:49               ` Richard Guenther
2009-11-19 15:52                 ` Richard Guenther
2009-11-19 17:37                 ` Andi Kleen
2009-11-19 17:39             ` Linus Torvalds
2009-11-19 17:51               ` Thomas Gleixner
2009-11-19 17:59               ` Steven Rostedt
2009-11-19 18:03                 ` Richard Guenther
2009-11-19 18:22                   ` Andrew Haley
2009-11-19 18:41                     ` Linus Torvalds
2009-11-19 18:43                       ` Linus Torvalds
2009-11-19 18:54                         ` Linus Torvalds
2009-11-19 19:01                           ` Thomas Gleixner
2009-11-23  9:16                             ` Jakub Jelinek
2009-11-23  9:51                               ` Thomas Gleixner
2009-11-19 19:10                           ` David Daney
2009-11-19 19:28                             ` Steven Rostedt
2009-11-19 19:46                               ` Frederic Weisbecker
2009-11-19 19:54                                 ` Kai Tietz
2009-11-19 20:05                                   ` Frederic Weisbecker
2009-11-19 20:05                                 ` Steven Rostedt
2009-11-19 20:17                                   ` Steven Rostedt
2009-11-19 20:28                                     ` Frederic Weisbecker
2009-11-19 20:25                                   ` Frederic Weisbecker
2009-11-19 20:36                                     ` Linus Torvalds
2009-11-19 20:44                                       ` Steven Rostedt
2009-11-19 19:50                               ` H. Peter Anvin
2009-11-19 20:06                                 ` Linus Torvalds
2009-11-19 21:12                                   ` Jeff Law
2009-11-19 20:10                                 ` Steven Rostedt
2009-11-19 21:05                                 ` Jeff Law
2009-11-19 18:31                   ` Thomas Gleixner
2009-11-19 18:38                   ` Linus Torvalds
2009-11-19 18:47                     ` Ingo Molnar
2009-11-19 19:06                       ` Steven Rostedt
2009-11-19 19:50                         ` Ingo Molnar
2009-11-20  9:57                         ` [PATCH] gcc mcount-nofp was " Andi Kleen
2009-11-20 12:34                           ` Steven Rostedt
2009-11-20 19:06                             ` H. Peter Anvin
2009-11-19 20:36                     ` Thomas Gleixner
2009-11-19 18:20             ` Andrew Haley
2009-11-19 18:33               ` Steven Rostedt
2009-11-19 18:36                 ` Andrew Pinski
2009-11-19 18:36                 ` Andrew Haley
2009-11-19 18:37                 ` H. Peter Anvin
2009-11-19 18:39               ` Thomas Gleixner
2009-11-20  5:23           ` [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue Steven Rostedt
2009-11-20  5:32             ` Steven Rostedt
2009-11-20 17:00             ` Steven Rostedt
2009-11-20 17:13               ` H. Peter Anvin
2009-11-20 19:35               ` Andrew Haley
2009-11-20 19:46                 ` Steven Rostedt
2009-11-20 19:49                   ` H. Peter Anvin
2009-11-22  9:38                 ` H.J. Lu
2009-11-22 17:20                   ` Andrew Haley
2009-11-22 23:30                     ` H.J. Lu
2009-11-24 14:43                       ` Andrew Haley
2009-11-24 14:55                         ` Thomas Gleixner
2009-11-24 15:06                           ` Jakub Jelinek
2009-11-24 15:32                             ` Andrew Haley
2009-11-24 15:36                               ` Jakub Jelinek
2009-11-24 15:46                                 ` Andrew Haley
2009-11-24 16:38                                   ` H. Peter Anvin
2009-11-24 17:12                                     ` Andrew Haley
2009-11-24 17:30                                       ` Steven Rostedt
2009-11-25 20:05                                         ` H. Peter Anvin
2009-11-24 19:55                                       ` H. Peter Anvin
2009-11-25 15:29                             ` Thomas Gleixner
2009-11-25 15:44                               ` Ingo Molnar
2009-11-25 15:53                                 ` Thomas Gleixner
2009-11-25 16:25                                   ` Ingo Molnar
2009-11-25 16:44                                 ` Jakub Jelinek
2009-11-25 20:12                                   ` H. Peter Anvin
2009-11-25 21:00                                     ` Andrew Haley
2009-11-22  9:05               ` Ingo Molnar
2009-11-20 10:30   ` [tip:timers/urgent] hrtimer: Fix /proc/timer_list regression tip-bot for Feng Tang
2009-11-20 14:19     ` Heiko Carstens
2009-11-19 20:48 BUG: GCC-4.4.x changes the function frame on some functions H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2009-11-19 21:14 H. Peter Anvin
2009-11-19 21:25 ` Jeff Law
2009-11-19 22:43   ` Steven Rostedt
2009-11-19 23:58     ` Jeff Law
2009-11-20  0:36       ` Thomas Gleixner
2009-11-20  0:59         ` Linus Torvalds
2009-11-20  1:27           ` Thomas Gleixner
2009-11-20  2:14             ` Thomas Gleixner
2009-11-20  1:29           ` H. Peter Anvin
2009-11-20  5:36           ` Ingo Molnar
2009-11-20 12:04         ` Andrew Haley
2009-11-20 12:22           ` Andrew Haley

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=alpine.LFD.2.00.0911191720030.24119@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=aph@redhat.com \
    --cc=feng.tang@intel.com \
    --cc=fweisbec@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hpa@zytor.com \
    --cc=jakub@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --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