From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757951Ab0JSVcy (ORCPT ); Tue, 19 Oct 2010 17:32:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48962 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757872Ab0JSVcx (ORCPT ); Tue, 19 Oct 2010 17:32:53 -0400 Date: Tue, 19 Oct 2010 17:32:26 -0400 From: Jason Baron To: David Daney Cc: Thomas Gleixner , Mathieu Desnoyers , Steven Rostedt , Koki Sanagi , Peter Zijlstra , Ingo Molnar , Frederic Weisbecker , nhorman@tuxdriver.com, scott.a.mcmillan@intel.com, laijs@cn.fujitsu.com, "H. Peter Anvin" , LKML , eric.dumazet@gmail.com, kaneshige.kenji@jp.fujitsu.com, David Miller , izumi.taku@jp.fujitsu.com, kosaki.motohiro@jp.fujitsu.com, Heiko Carstens , "Luck, Tony" Subject: Re: [PATCH] tracing: Cleanup the convoluted softirq tracepoints Message-ID: <20101019213225.GB2855@redhat.com> References: <1287398936.29097.1548.camel@twins> <4CBD79CF.2060706@jp.fujitsu.com> <20101019132236.GA19197@Krystal> <1287496495.16971.372.camel@gandalf.stny.rr.com> <20101019142820.GA14520@Krystal> <4CBE0AC6.3040402@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CBE0AC6.3040402@caviumnetworks.com> User-Agent: Mutt/1.5.20 (2010-07-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 19, 2010 at 02:16:54PM -0700, David Daney wrote: > On 10/19/2010 12:49 PM, Thomas Gleixner wrote: > [...] > >So that saves _TWO_ bytes of text and replaces: > > > >- 1e: 83 3d 00 00 00 00 00 cmpl $0x0,0x0(%rip) # 25 > >- 25: 74 4d je 74 > >+ 1e: e9 00 00 00 00 jmpq 23 > >+ 23: eb 4d jmp 72 > > > >So it trades a conditional vs. two jumps ? WTF ?? > > > >I thought that jumplabel magic was supposed to get rid of the jump > >over the tracing code ? In fact it adds another jump. Whatfor ? > > The 'asm goto' construct in GCC-4.5 is deficient in this area. > > GCC assumes that all exit paths from an 'asm goto' are equally > likely, so the tracing (or dynamic printk etc.) code is assumed to > be hot and is emitted inline. Since they are inline like this, > there are all these jumps around them and they pollute the I-Cache. > > I was looking at fixing it, but I think a true general purpose fix > would require enhancing GCC's grammar to allow specifying of the > 'likelyness' of each exit path from 'asm goto'. > > David Daney > right, the next step is adding support for hot/cold labels, so the tracing code will be annotaed with a 'cold' label. Thus, not adding the 'jmp' above on line '23', and in fact moving the tracing code out-of-line. Maybe I haven't been clear on this. thanks, -Jason