From: Ingo Molnar on

* Peter Zijlstra <peterz(a)infradead.org> wrote:

> On Wed, 2010-06-09 at 17:39 -0400, Jason Baron wrote:
> > + select HAVE_ARCH_JUMP_LABEL if !CC_OPTIMIZE_FOR_SIZE
>
> That deserves a comment somewhere, it basically makes OPTIMIZE_FOR_SIZE
> useless...

Hm, we need more than a comment for that - distros enable CC_OPTIMIZE_FOR_SIZE
all the time, for the massive kernel image (and hotpath cache footprint)
savings. Is this fixable?

Thanks,

Ingo

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Peter Zijlstra on
On Wed, 2010-06-09 at 17:39 -0400, Jason Baron wrote:
> + select HAVE_ARCH_JUMP_LABEL if !CC_OPTIMIZE_FOR_SIZE

That deserves a comment somewhere, it basically makes OPTIMIZE_FOR_SIZE
useless...


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Peter Zijlstra on
On Wed, 2010-06-09 at 17:39 -0400, Jason Baron wrote:
> +#define JUMP_LABEL(tag, label, cond) \
> + do { \
> + extern const char __jlstrtab_##tag[]; \
> + asm goto("1:" \
> + JUMP_LABEL_NOP \
> + ".pushsection __jump_table, \"a\" \n\t"\
> + _ASM_PTR "1b, %l[" #label "], %c0 \n\t" \
> + ".popsection \n\t" \
> + : : "i" (__jlstrtab_##tag) : : label);\
> + } while (0)

Would it make sense to have that macro at least evaluate cond in some
way?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Peter Zijlstra on
On Wed, 2010-06-09 at 17:39 -0400, Jason Baron wrote:
> add x86 support for jump label. I'm keeping this patch separate so its clear to
> arch maintainers what was required for x86 support this new feature. hopefully,
> it wouldn't be too painful for other arches.

Well patch 10 really rather spoils that, doesn't it?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Andi Kleen on
On Thu, Jun 10, 2010 at 02:14:40PM +0200, Ingo Molnar wrote:
>
> * Peter Zijlstra <peterz(a)infradead.org> wrote:
>
> > On Wed, 2010-06-09 at 17:39 -0400, Jason Baron wrote:
> > > + select HAVE_ARCH_JUMP_LABEL if !CC_OPTIMIZE_FOR_SIZE
> >
> > That deserves a comment somewhere, it basically makes OPTIMIZE_FOR_SIZE
> > useless...
>
> Hm, we need more than a comment for that - distros enable CC_OPTIMIZE_FOR_SIZE
> all the time, for the massive kernel image (and hotpath cache footprint)
> savings. Is this fixable?

Actually the big distros (RHEL, SLES) disable it all the time now. It costs you
in some benchmarks. The code generated by -Os is often terrible.

Nearly everytime I investigate some bad asm code being generated by gcc
it goes away when that flag is disabled.

A much better to get smaller kernel images is to do more __cold
annotations for slow paths. Newer gcc will then simply only do -Os for these
functions.

It's already done for __init.

-Andi
--
ak(a)linux.intel.com -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/