linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] gcc feature request: Moving blocks into sections
@ 2013-08-05 16:55 Steven Rostedt
  2013-08-05 17:02 ` H. Peter Anvin
                   ` (3 more replies)
  0 siblings, 4 replies; 68+ messages in thread
From: Steven Rostedt @ 2013-08-05 16:55 UTC (permalink / raw)
  To: LKML, gcc
  Cc: Linus Torvalds, Ingo Molnar, Mathieu Desnoyers, H. Peter Anvin,
	Thomas Gleixner, David Daney, Behan Webster, Peter Zijlstra

[ sent to both Linux kernel mailing list and to gcc list ]

I was looking at some of the old code I still have marked in my TODO
list, that I never pushed to get mainlined. One of them is to move trace
point logic out of the fast path to get rid of the stress that it
imposes on the icache.

Almost a full year ago, Mathieu suggested something like:

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

https://lkml.org/lkml/2012/8/9/658

Which got me thinking. How hard would it be to set a block in its own
section. Like what Mathieu suggested, but it doesn't have to be
".unlikely".

if (x) __attibute__((section(".foo"))) {
	/* do something */
}

Then have in the assembly, simply:

	test x
	beq	2f
1:
	/* continue */
	ret

2:
	jmp	foo1
3:
	jmp	1b


Then in section ".foo":

foo1:
	/* do something */
	jmp 3b

Perhaps we can't use the section attribute. We could create a new
attribute. Perhaps a __jmp_section__ or whatever (I'm horrible with
names).

Is this a possibility?

If this is possible, we can get a lot of code out of the fast path.
Things like stats and tracing, which is mostly default off. I would
imagine that we would get better performance by doing this. Especially
as tracepoints are being added all over the place.

Thanks,

-- Steve



^ permalink raw reply	[flat|nested] 68+ messages in thread

end of thread, other threads:[~2013-08-13 14:52 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-05 16:55 [RFC] gcc feature request: Moving blocks into sections Steven Rostedt
2013-08-05 17:02 ` H. Peter Anvin
2013-08-05 17:24   ` Steven Rostedt
2013-08-05 17:12 ` Linus Torvalds
2013-08-05 17:15   ` Linus Torvalds
2013-08-05 17:55   ` Steven Rostedt
2013-08-05 18:11     ` Steven Rostedt
2013-08-05 18:17     ` H. Peter Anvin
2013-08-05 18:23       ` Steven Rostedt
2013-08-05 18:29         ` H. Peter Anvin
2013-08-05 18:49           ` Steven Rostedt
2013-08-05 18:51             ` H. Peter Anvin
2013-08-05 19:01               ` Linus Torvalds
2013-08-05 19:54                 ` Mathieu Desnoyers
2013-08-05 19:57                   ` Linus Torvalds
2013-08-05 20:02                     ` Steven Rostedt
2013-08-05 21:28                     ` Mathieu Desnoyers
2013-08-05 21:43                       ` H. Peter Anvin
2013-08-06  4:14                         ` Mathieu Desnoyers
2013-08-06  4:28                           ` H. Peter Anvin
2013-08-06 16:15                         ` Steven Rostedt
2013-08-06 16:19                           ` H. Peter Anvin
2013-08-06 16:26                             ` Steven Rostedt
2013-08-06 16:29                               ` H. Peter Anvin
2013-08-05 21:44                       ` Steven Rostedt
2013-08-05 22:08                         ` Mathieu Desnoyers
2013-08-05 19:09               ` Steven Rostedt
2013-08-05 18:20     ` Linus Torvalds
2013-08-05 18:24       ` Linus Torvalds
2013-08-05 18:34         ` Linus Torvalds
2013-08-05 18:38           ` H. Peter Anvin
2013-08-05 19:04           ` Steven Rostedt
2013-08-05 19:40           ` Marek Polacek
2013-08-05 19:56             ` Linus Torvalds
2013-08-05 19:57             ` Jason Baron
2013-08-05 20:35               ` Richard Henderson
2013-08-06  2:26                 ` Jason Baron
2013-08-06  3:03                   ` Steven Rostedt
2013-08-05 18:33       ` H. Peter Anvin
2013-08-05 18:39       ` Steven Rostedt
2013-08-05 18:49         ` Linus Torvalds
2013-08-05 19:39           ` Steven Rostedt
2013-08-06 14:19           ` Steven Rostedt
2013-08-06 17:48             ` Linus Torvalds
2013-08-06 17:58               ` Steven Rostedt
2013-08-06 20:33                 ` Mathieu Desnoyers
2013-08-06 20:43                   ` Steven Rostedt
2013-08-07  0:45                     ` Steven Rostedt
2013-08-07  0:56                       ` Steven Rostedt
2013-08-07  5:06                         ` Ondřej Bílka
2013-08-07 15:02                           ` Steven Rostedt
2013-08-07 16:03                             ` Mathieu Desnoyers
2013-08-07 16:11                               ` Steven Rostedt
2013-08-07 23:22                                 ` Mathieu Desnoyers
2013-08-05 20:06         ` Jason Baron
2013-08-05 19:04 ` Andi Kleen
2013-08-05 19:16   ` Steven Rostedt
2013-08-05 19:30     ` Xinliang David Li
2013-08-05 19:25   ` Linus Torvalds
2013-08-12  9:17 ` Peter Zijlstra
2013-08-12 14:56   ` H. Peter Anvin
2013-08-12 16:02     ` Andi Kleen
2013-08-12 16:11       ` Peter Zijlstra
2013-08-12 16:09     ` Peter Zijlstra
2013-08-12 17:47       ` H. Peter Anvin
2013-08-13  7:50         ` Peter Zijlstra
2013-08-13 14:46           ` H. Peter Anvin
2013-08-13 14:52             ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).