Advertisement
Guest User

kernel-38-gcc47-1.patch

a guest
Sep 2nd, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.29 KB | None | 0 0
  1. The original patch was written by jeroen@linuxforge.net
  2.  
  3. Benchmarks by graysky
  4.  
  5. Three different machines running a generic x86-64 kernel and an otherwise identical kernel running with the optimized gcc options were tested using a make based endpoint.
  6.  
  7. Conclusion:
  8. There are small but real speed increases using a make endpoint to running with this patch.
  9.  
  10. Details:
  11. 1) Three test machines: Intel Xeon X3360, Intel i7-2620M, Intel Core i7-3660K.
  12. 2) All ran the make benchmark (linked below) 35 times while booted into a 'generic' kernel. Then all ran the same make benchmark 35 times after booting into an optimized kernel. Below are the optimizations chosen for each machine.
  13. 2a) X3360 = core2
  14. 2b) i7-2620M = corei7-avx
  15. 2c) i7-3660K = core-avx-i
  16. 3) Analyzed resulting distributions for statistical significance via ANOVA plots that clearly show statistically significant albeit small differences.
  17.  
  18. Links to ANOVA plots:
  19. http://s19.postimage.org/68urcofzn/corei7_avx.png
  20. http://s19.postimage.org/ozwomuak3/core_avx_i.png
  21. http://s19.postimage.org/d0l6fj4z7/core2.png
  22.  
  23. Discussion:
  24. 1) All the assumptions for ANOVA are met:
  25. *Data are normally distributed as show in the normal quantile plots.
  26. *The population variances are fairly equal (Levene and Barlett tests).
  27.  
  28. 2) The ANOVA plots clearly show significance.
  29. *Pair-wise analysis by Tukey-Kramer shows significance at the 0.05 level for all CPUs compared.
  30. Below are the differences in median values:
  31.  
  32. core2 +87.5 ms
  33. corei7-avx +79.7 ms
  34. core-avx-i +257.2 ms
  35.  
  36. References:
  37. Bash script that controls the benchmark: https://github.com/graysky2/bin/blob/master/bench
  38. Log file generated by script: http://repo-ck.com/bench/compile_time_optimization.txt.gz
  39.  
  40. ---
  41. --- linux-3.8/arch/x86/include/asm/module.h 2012-12-10 22:30:57.000000000 -0500
  42. +++ linux-3.8.mod/arch/x86/include/asm/module.h 2013-01-02 08:24:39.225359956 -0500
  43. @@ -17,6 +17,14 @@
  44. #define MODULE_PROC_FAMILY "586MMX "
  45. #elif defined CONFIG_MCORE2
  46. #define MODULE_PROC_FAMILY "CORE2 "
  47. +#elif defined CONFIG_MCOREI7
  48. +#define MODULE_PROC_FAMILY "COREI7 "
  49. +#elif defined CONFIG_MCOREI7AVX
  50. +#define MODULE_PROC_FAMILY "COREI7AVX "
  51. +#elif defined CONFIG_MCOREAVXI
  52. +#define MODULE_PROC_FAMILY "COREAVXI "
  53. +#elif defined CONFIG_MCOREAVX2
  54. +#define MODULE_PROC_FAMILY "COREAVX2 "
  55. #elif defined CONFIG_MATOM
  56. #define MODULE_PROC_FAMILY "ATOM "
  57. #elif defined CONFIG_M686
  58. @@ -35,6 +43,16 @@
  59. #define MODULE_PROC_FAMILY "K7 "
  60. #elif defined CONFIG_MK8
  61. #define MODULE_PROC_FAMILY "K8 "
  62. +#elif defined CONFIG_MK10
  63. +#define MODULE_PROC_FAMILY "K10 "
  64. +#elif defined CONFIG_MBARCELONA
  65. +#define MODULE_PROC_FAMILY "BARCELONA "
  66. +#elif defined CONFIG_MBOBCAT
  67. +#define MODULE_PROC_FAMILY "BOBCAT "
  68. +#elif defined CONFIG_MBULLDOZER
  69. +#define MODULE_PROC_FAMILY "BULLDOZER "
  70. +#elif defined CONFIG_MPILEDRIVER
  71. +#define MODULE_PROC_FAMILY "PILEDRIVER "
  72. #elif defined CONFIG_MELAN
  73. #define MODULE_PROC_FAMILY "ELAN "
  74. #elif defined CONFIG_MCRUSOE
  75. --- linux-3.8/arch/x86/Kconfig.cpu 2013-02-20 11:29:58.264481742 -0500
  76. +++ linux-3.8.mod/arch/x86/Kconfig.cpu 2013-02-20 11:32:57.613339867 -0500
  77. @@ -139,7 +139,7 @@
  78.  
  79.  
  80. config MK6
  81. - bool "K6/K6-II/K6-III"
  82. + bool "AMD K6/K6-II/K6-III"
  83. depends on X86_32
  84. ---help---
  85. Select this for an AMD K6-family processor. Enables use of
  86. @@ -147,7 +147,7 @@
  87. flags to GCC.
  88.  
  89. config MK7
  90. - bool "Athlon/Duron/K7"
  91. + bool "AMD Athlon/Duron/K7"
  92. depends on X86_32
  93. ---help---
  94. Select this for an AMD Athlon K7-family processor. Enables use of
  95. @@ -155,12 +155,48 @@
  96. flags to GCC.
  97.  
  98. config MK8
  99. - bool "Opteron/Athlon64/Hammer/K8"
  100. + bool "AMD Opteron/Athlon64/Hammer/K8"
  101. ---help---
  102. Select this for an AMD Opteron or Athlon64 Hammer-family processor.
  103. Enables use of some extended instructions, and passes appropriate
  104. optimization flags to GCC.
  105.  
  106. +config MK10
  107. + bool "AMD 61xx/7x50/PhenomX3/X4/II/K10"
  108. + ---help---
  109. + Select this for an AMD 61xx Eight-Core Magny-Cours, Athlon X2 7x50,
  110. + Phenom X3/X4/II, Athlon II X2/X3/X4, or Turion II-family processor.
  111. + Enables use of some extended instructions, and passes appropriate
  112. + optimization flags to GCC.
  113. +
  114. +config MBARCELONA
  115. + bool "AMD Barcelona"
  116. + ---help---
  117. + Select this for AMD Barcelona and newer processors.
  118. +
  119. + Enables -march=barcelona
  120. +
  121. +config MBOBCAT
  122. + bool "AMD Bobcat"
  123. + ---help---
  124. + Select this for AMD Bobcat processors.
  125. +
  126. + Enables -march=btver1
  127. +
  128. +config MBULLDOZER
  129. + bool "AMD Bulldozer"
  130. + ---help---
  131. + Select this for AMD Bulldozer processors.
  132. +
  133. + Enables -march=bdver1
  134. +
  135. +config MPILEDRIVER
  136. + bool "AMD Piledriver"
  137. + ---help---
  138. + Select this for AMD Piledriver processors.
  139. +
  140. + Enables -march=bdver2
  141. +
  142. config MCRUSOE
  143. bool "Crusoe"
  144. depends on X86_32
  145. @@ -252,7 +288,7 @@
  146. in /proc/cpuinfo. Family 15 is an older Xeon, Family 6 a newer one.
  147.  
  148. config MCORE2
  149. - bool "Core 2/newer Xeon"
  150. + bool "Intel Core 2"
  151. ---help---
  152.  
  153. Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and
  154. @@ -260,6 +296,41 @@
  155. family in /proc/cpuinfo. Newer ones have 6 and older ones 15
  156. (not a typo)
  157.  
  158. + Enables -march=core2
  159. +
  160. +config MCOREI7
  161. + bool "Intel Core i7"
  162. + ---help---
  163. +
  164. + Select this for the Intel Nehalem platform. Intel Nehalem proecessors
  165. + include Core i3, i5, i7, Xeon: 34xx, 35xx, 55xx, 56xx, 75xx processors.
  166. +
  167. + Enables -march=corei7
  168. +
  169. +config MCOREI7AVX
  170. + bool "Intel Core 2nd Gen AVX"
  171. + ---help---
  172. +
  173. + Select this for 2nd Gen Core processors including Sandy Bridge.
  174. +
  175. + Enables -march=corei7-avx
  176. +
  177. +config MCOREAVXI
  178. + bool "Intel Core 3rd Gen AVX"
  179. + ---help---
  180. +
  181. + Select this for 3rd Gen Core processors including Ivy Bridge.
  182. +
  183. + Enables -march=core-avx-i
  184. +
  185. +config MCOREAVX2
  186. + bool "Intel Core AVX-2"
  187. + ---help---
  188. +
  189. + Select this for AVX-2 enabled processors including Haswell.
  190. +
  191. + Enables -march=corei7-avx-2
  192. +
  193. config MATOM
  194. bool "Intel Atom"
  195. ---help---
  196. @@ -300,7 +371,7 @@
  197. config X86_L1_CACHE_SHIFT
  198. int
  199. default "7" if MPENTIUM4 || MPSC
  200. - default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU
  201. + default "6" if MK7 || MK8 || MK10 || MBARCELONA || MBOBCAT || MBULLDOZER || MPILEDRIVER || MPENTIUMM || MCORE2 || MCOREI7 || MCOREI7AVX || MCOREAVXI || MCOREAVX2 || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU
  202. default "4" if MELAN || M486 || MGEODEGX1
  203. default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
  204.  
  205. @@ -331,11 +402,11 @@
  206.  
  207. config X86_INTEL_USERCOPY
  208. def_bool y
  209. - depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2
  210. + depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MK10 || MBARCELONA || MEFFICEON || MCORE2 || MCOREI7 || MCOREI7AVX || MCOREAVXI || MCOREAVX2
  211.  
  212. config X86_USE_PPRO_CHECKSUM
  213. def_bool y
  214. - depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM
  215. + depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MK10 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MCOREI7 || MCOREI7AVX || MCOREAVXI || MCOREAVX2 || MATOM
  216.  
  217. config X86_USE_3DNOW
  218. def_bool y
  219. @@ -363,17 +434,17 @@
  220.  
  221. config X86_TSC
  222. def_bool y
  223. - depends on ((MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MATOM) && !X86_NUMAQ) || X86_64
  224. + depends on ((MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MK10 || MBARCELONA || MBOBCAT || MBULLDOZER || MPILEDRIVER || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MCOREI7 || MCOREI7-AVX || MATOM) && !X86_NUMAQ) || X86_64
  225.  
  226. config X86_CMPXCHG64
  227. def_bool y
  228. - depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM
  229. + depends on X86_PAE || X86_64 || MCORE2 || MCOREI7 || MCOREI7AVX || MCOREAVXI || MCOREAVX2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM
  230.  
  231. # this should be set for all -march=.. options where the compiler
  232. # generates cmov.
  233. config X86_CMOV
  234. def_bool y
  235. - depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX)
  236. + depends on (MK8 || MK10 || MBARCELONA || MBOBCAT || MBULLDOZER || MPILEDRIVER || MK7 || MCORE2 || MCOREI7 || MCOREI7AVX || MCOREAVXI || MCOREAVX2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX)
  237.  
  238. config X86_MINIMUM_CPU_FAMILY
  239. int
  240.  
  241. --- linux-3.8/arch/x86/Makefile 2012-12-10 22:30:57.000000000 -0500
  242. +++ linux-3.8.mod/arch/x86/Makefile 2013-01-02 08:39:20.199840158 -0500
  243. @@ -58,10 +58,23 @@
  244.  
  245. # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
  246. cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
  247. + cflags-$(CONFIG_MK10) += $(call cc-option,-march=amdfam10)
  248. + cflags-$(CONFIG_MBARCELONA) += $(call cc-option,-march=barcelona)
  249. + cflags-$(CONFIG_MBOBCAT) += $(call cc-option,-march=btver1)
  250. + cflags-$(CONFIG_MBULLDOZER) += $(call cc-option,-march=bdver1)
  251. + cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-march=bdver2)
  252. cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
  253.  
  254. cflags-$(CONFIG_MCORE2) += \
  255. - $(call cc-option,-march=core2,$(call cc-option,-mtune=generic))
  256. + $(call cc-option,-march=core2,$(call cc-option,-mtune=core2))
  257. + cflags-$(CONFIG_MCOREI7) += \
  258. + $(call cc-option,-march=corei7,$(call cc-option,-mtune=corei7))
  259. + cflags-$(CONFIG_MCOREI7AVX) += \
  260. + $(call cc-option,-march=corei7-avx,$(call cc-option,-mtune=corei7-avx))
  261. + cflags-$(CONFIG_MCOREAVXI) += \
  262. + $(call cc-option,-march=core-avx-i,$(call cc-option,-mtune=core-avx-i))
  263. + cflags-$(CONFIG_MCOREAVX2) += \
  264. + $(call cc-option,-march=core-avx2,$(call cc-option,-mtune=core-avx2))
  265. cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom) \
  266. $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
  267. cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
  268. --- linux-3.8/arch/x86/Makefile_32.cpu 2012-12-10 22:30:57.000000000 -0500
  269. +++ linux-3.8.mod/arch/x86/Makefile_32.cpu 2013-01-02 08:41:23.554252806 -0500
  270. @@ -25,6 +25,11 @@
  271. # They make zero difference whatsosever to performance at this time.
  272. cflags-$(CONFIG_MK7) += -march=athlon
  273. cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,-march=athlon)
  274. +cflags-$(CONFIG_MK10) += $(call cc-option,-march=amdfam10,-march=athlon)
  275. +cflags-$(CONFIG_MBARCELONA) += $(call cc-option,-march=barcelona,-march=athlon)
  276. +cflags-$(CONFIG_MBOBCAT) += $(call cc-option,-march=btver1,-march=athlon)
  277. +cflags-$(CONFIG_MBULLDOZER) += $(call cc-option,-march=bdver1,-march=athlon)
  278. +cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-march=bdver2,-march=athlon)
  279. cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
  280. cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
  281. cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586)
  282. @@ -33,6 +38,10 @@
  283. cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686)
  284. cflags-$(CONFIG_MVIAC7) += -march=i686
  285. cflags-$(CONFIG_MCORE2) += -march=i686 $(call tune,core2)
  286. +cflags-$(CONFIG_MCOREI7) += -march=i686 $(call tune,corei7)
  287. +cflags-$(CONFIG_MCOREI7AVX) += -march=i686 $(call tune,corei7-avx)
  288. +cflags-$(CONFIG_MCOREAVXI) += -march=i686 $(call tune,core-avx-i)
  289. +cflags-$(CONFIG_MCOREAVX2) += -march=i686 $(call tune,core-avx-2)
  290. cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom,$(call cc-option,-march=core2,-march=i686)) \
  291. $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement