Re: [2.6 patch] add a config option for -Os compilation

From: Martin J. Bligh
Date: Sat Oct 18 2003 - 10:50:07 EST


>> I really doubt it. Kernel CPU footprint is dominated by dcache misses. If
>> -Os reduces icache footprint it may even be a net win; people tend to
>> benchmark things in tight loops, which favours fast code over small code.
>
> The main effect of -Os compared to -O2 (besides disabling some
> reordering of the code and prefetching) is the disabling of various
> alignments. I doubt that's a win on all CPUs.
>
>> > - I've already seen a report for an ICE in gcc 2.95 of a user compiling
>> > kernel 2.4 with -Os [1]
>>
>> Well there's only one way to find out if we'll hit that. How's about you
>> cook me a patch which switches to -Os unconditionally and we'll see how it
>> goes?
>
> I still dislike it, but the patch is below.

Please don't - I benchmarked it a while ago, and it's definitely slower.
If you have a puny 128K L2 cache, it might help, but it definitely needs
to be optional.

M.

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