Re: [PATCH] tracing: Cleanup the convoluted softirq tracepoints

From: David Daney
Date: Tue Oct 19 2010 - 17:39:15 EST


On 10/19/2010 02:32 PM, Jason Baron wrote:
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<test+0x25>
- 25: 74 4d je 74<test+0x74>
+ 1e: e9 00 00 00 00 jmpq 23<test+0x23>
+ 23: eb 4d jmp 72<test+0x72>

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.


Ok, so is anybody working on doing that? GCC-4.6 stage 1 (the time when a change like this could be merged) closes in 8 days.

It is unfortunate that we have this shiny new feature that can't really be used because the infrastructure is only half baked.

David Daney
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/