The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: David Daney <ddaney.cavm@gmail.com>,
	"H. Peter Anvin" <hpa@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Avi Kivity <avi@redhat.com>,
	Christoph Hellwig <hch@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC][PATCH] tracepoints: Move the work out of line from hotpath sections
Date: Thu, 9 Aug 2012 22:05:23 -0400	[thread overview]
Message-ID: <20120810020523.GA18832@Krystal> (raw)
In-Reply-To: <1344562886.6935.93.camel@gandalf.stny.rr.com>

* Steven Rostedt (rostedt@goodmis.org) wrote:
> On Thu, 2012-08-09 at 16:54 -0700, David Daney wrote:
> > On 08/09/2012 04:16 PM, H. Peter Anvin wrote:
> > > On 08/09/2012 03:25 PM, Steven Rostedt wrote:
> > >>>
> > >>> It might be better to improve gcc to move really cold branches out of
> > >>> line (really, really far away), and use the compiler to do this, rather
> > >>> than to use an extra indirection that adds bloat and complexity to the
> > >>> kernel.
> > 
> > Oh, you mean like: -freorder-blocks-and-partition
> 
> Actually, what would be really nice is to place a block in a section of
> your choice. Something like:
> 
> 
> 	if (unlikely(x)) __attribute__((section(".unlikely"))) {
> 		/* code here will be in the ".unlikely" section */
> 	}

In your example, is the attribute attached to the if() or the following
basic block ? Attaching it to the basic block allows a nice level of
genericity:

if (unlikely(x)) __attribute__((section(".unlikely"))) {
        ...
} else __attribute__((section(".likely"))) {
        ...
}

or

switch (x) {
        case 0:
        case 1:
        case 6:
        __attribute__((section(".likely"))) {
                ...
                break;
        }
        default:
        __attribute__((section(".unlikely"))) {
                ...
                break;
        }
}

Thanks,

Mathieu

> 
> -- Steve
> 
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com

  reply	other threads:[~2012-08-10  2:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-09 20:40 [RFC][PATCH] tracepoints: Move the work out of line from hotpath sections Steven Rostedt
2012-08-09 20:50 ` Mathieu Desnoyers
2012-08-09 22:25   ` Steven Rostedt
2012-08-09 23:16     ` H. Peter Anvin
2012-08-09 23:54       ` David Daney
2012-08-10  1:41         ` Steven Rostedt
2012-08-10  2:05           ` Mathieu Desnoyers [this message]
2012-08-10  3:09             ` 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=20120810020523.GA18832@Krystal \
    --to=mathieu.desnoyers@efficios.com \
    --cc=akpm@linux-foundation.org \
    --cc=avi@redhat.com \
    --cc=ddaney.cavm@gmail.com \
    --cc=hch@infradead.org \
    --cc=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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