[lkml]   [2009]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH RFC] [X86] Compile Option Os versus O2 on latest x86 platform
From: Ma Ling <>

Hi All

In current kernel compile original option we prefer Os to O2. Os will reduce
compiled kernel code size obviously, and O2 pay more attention to performance
than code size, so in real environment O2 will bring more i-cache miss than Os,
totally performance should slowdown.

In our system test machine kernel code size from Os is 12M, and that from O2 is 14M.

But we have two questions about it on latest platform:
1. 10% * current kernel code size from Os(CPU execution path)
is far more L1 i-cache size, the difference of i-cache-miss counts from
both options should become little.
2. our latest platform should has excellent prefetch capability by adjusting
predication execution path.

Based on above reasons we re-compiled linux kernel with O2 option on below platform.
CPU type: 2P Quad-core Core i7(2 socket*4 core *2 hyper threads)
CPU frequency: 2670MHz
Memory: 6 x 1GBMb

We mainly tested common and stable benchmarks two times, results show
O2 performance is better than Os (linux kernel version 2.6.32-rc8)

Benchmarks: improvement
volano 8%
netperf 6.7%
tbench 6.45%
Kbuild 5.5% (3 time test, average improvement)
specjbb2000 2%
fio 2%
specjbb2005 No change
cpu2000 No change
aim7 No change
hackbench No Change
oltp No Change

This patch try to enable O2 option and disable Os option.

Appreciate any comments.


arch/x86/configs/x86_64_defconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
index 6c86acd..d564b90 100644
--- a/arch/x86/configs/x86_64_defconfig
+++ b/arch/x86/configs/x86_64_defconfig
@@ -126,7 +126,7 @@ CONFIG_INITRAMFS_SOURCE=""
# CONFIG_EMBEDDED is not set

 \ /
  Last update: 2009-11-26 09:03    [W:0.068 / U:2.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site