Re: [RFC][ PATCH -tip 0/6] kprobes: Kprobes jump optimization support

From: Masami Hiramatsu
Date: Wed Jun 17 2009 - 18:26:22 EST


Masami Hiramatsu wrote:
>> (1) The compiler is allowed to do cross-function optimization within a
>> compilation unit where code in one function jumps into the middle of
>> another function.
>
> Hmm, right. This is a real problem. I think I have 2 options for this
> issue. I counted the cross-function jumps on my kernel roughly, and
> I found there were about 856 jumps jump into 158 functions (it might be
> incorrect, I just used 'objdump -d', and it also disassembles data
> section...)

Hmm, almost all of these functions are jumped from .fixup section.
Obviously, these should be mentioned.

> - Making a blacklist of target functions or addresses which cross-function
> jumps jump into. This will be done by disassembling kernel when starting up
> kernel and loading modules.(or, at build-time)

If we can make this blacklist, it will include above .fixup section.

>
> - Just disables cross-function optimization by adding --param
> min-crossjump-insns=XXXX where XXXX is enough big number, when
> CONFIG_OPTPROBES=y

BTW, I've tried to compile with min-crossjump-insns=32768. It actually
increased vmlinux size (about 1%),

text data bss dec hex filename
5767574 2022487 1521264 9311325 8e145d vmlinux-crossjump
5809551 2022487 1521264 9353302 8eb856 vmlinux-noncrossjump

However, with crossjumps opt, it seems not to add any jumps which
jump into the middle of other functions...

Thanks,

--
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@xxxxxxxxxx

--
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/