How to use #2

libertyspike138 opened this Issue Apr 7, 2013 · 7 comments


None yet

3 participants


Wondering how to apply this patch.
I'm assuming you use the GNU patch program but on what file?

graysky2 commented Apr 7, 2013

Just apply to the linux kernel source prior to build:
cd /path/to/source patch -Np1 -i /path/to/kernel-38-gcc48-1.patch

Thank you for the quick reply! I have a couple more questions if you don't mind. Is this normal running the patch?
"Hunk #7 FAILED at 384."
I was looking for a way to optimize performance for my system that has 2 older netburst xeons (SL84B) in it so I had recompiled the kernel setting that cpu flag instead of the generic X86_64 but while benchmarking with hardinfo my results were the same. Would this patch help with that or only the new chipsets listed?
I'm assuming it would help with my (B840) cpu?
Thanks for your time!

graysky2 commented Apr 8, 2013

That is odd. What version of the kernel are you trying to patch? For me, the patch applies cleanly into the the 3.8 source:

% cd /scratch/linux-3.8 && patch -Np1 -i kernel-38-gcc48-1.patch
patching file arch/x86/include/asm/module.h
patching file arch/x86/Kconfig.cpu
patching file arch/x86/Makefile
patching file arch/x86/Makefile_32.cpu

To your question: I dunno about hardinfo, see my README in the front of this github page for my results. Note that the differences were small - on the order of 250 ms in the best case... but those are statistically significant differences in all cases. Details and links to the script in the README.

cmr commented Apr 9, 2013

@libertyspike138 you should apply this patch before any other patches, ie to a vanilla release (3.x, not 3.x.y)

graysky2 commented Apr 9, 2013

Refer to the linux-ck PKGBUILD in which the order is

Upstream version bump then this patch... it shouldn't matter though; if any of these file have changed in the version bump from upstream, either my patch will fail to apply, or if you patch the source first, their patch will fail.

@libertyspike138 - Safe to close this issue? Can you get the patch to apply to your 3.8 tree?

I'm currently on Ubuntu 12.04 which is Kernel 3.2.X.
After grabbing the clean source I patched it and compiled it. When I tried the autodetect optimizations in CPU make it spit a bunch of errors but when selecting the older xeon which was already an option before the patch I only got the one error but was still able to compile it and it is running.
I see no noticeable improvements though.
I will have to try again on the new PC when I get the chance to.


I do not believe this patch will apply to the 3.2 tree; it is meant for the 3.8 tree.

EDIT: Right
% tar Jxf linux-3.2.43.tar.xz && cd $_
% patch -Np1 -i kernel-38-gcc48-2.patch
patching file arch/x86/include/asm/module.h
Hunk #1 succeeded at 17 (offset 2 lines).
Hunk #2 succeeded at 45 (offset 2 lines).
patching file arch/x86/Kconfig.cpu
Hunk #1 succeeded at 147 (offset 8 lines).
Hunk #2 succeeded at 155 (offset 8 lines).
Hunk #3 succeeded at 163 (offset 8 lines).
Hunk #4 succeeded at 295 (offset 8 lines).
Hunk #5 succeeded at 313 (offset 8 lines).
Hunk #6 succeeded at 355 (offset 8 lines).
Hunk #7 FAILED at 384.
Hunk #8 succeeded at 453 (offset 38 lines).
Hunk #9 succeeded at 485 (offset 38 lines).
1 out of 9 hunks FAILED -- saving rejects to file arch/x86/Kconfig.cpu.rej
patching file arch/x86/Makefile
Hunk #1 succeeded at 50 with fuzz 1 (offset -7 lines).
patching file arch/x86/Makefile_32.cpu
Hunk #1 succeeded at 24 (offset 1 line).
Hunk #2 succeeded at 39 (offset 1 line).

@graysky2 graysky2 closed this Apr 15, 2013
@graysky2 graysky2 added the question label Sep 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment