Home page of this blog

Friday, June 10, 2011

Custom kernel 2.6.39.1 ubuntu amd64 packages optimized for i3, i5 and i7


This package is created in Ubuntu 11.04 and should install fine in all versions of Ubuntu Linux 11.04 (as well 10.10) and Linux Mint 11 (as well Mint 10) (should as well in debian squeeze but not sure about dkms)

The build is for 64bit i3,i5 and i7 processors and will work with only with i3, i5, or i7 processors

The following are the configuration settings

  1. Kernel Timer Frequency set to 1000 HZ
  2. Processor is selected as CORE2
  3. Makefile and Makefile_32 modified to reflect march settings and mtune settings to corei7 (new arch of gcc 4.6)
  4. Scheduled autogroup enabled
  5. Transparent hugepage support enabled
  6. Copied kernel source to /usr/src and built from /usr/src folder to avoid symlink issues with the built packages (actually when built from /home/sankaran, the built binary will have symlinks to /home/sankaran which is ludicrous)
  7. Used enterprise linux kernel config as the base config and the kernel mostly seems to have no kernel debug prints because of it. Hence it runs considerably faster than stock Ubuntu kernel (well we can feel it) (I extracted the srpm to recreate the el6 config, the el6 srpm can be downloaded from http://ftp.redhat.com/redhat/linux/enterprise/6Workstation/en/os/SRPMS/kernel-2.6.32-131.0.15.el6.src.rpm)
    Also I enabled transparent hugepages in the kernel config which I added in the newly created config(which was not there in the el6 config by default)

How to install

To install

sudo dpkg -i linux-image-2.6.39.1-corei7_14.00_amd64.deb linux-headers-2.6.39.1-corei7_14.00_amd64.deb

followed by (these steps update-initramfs and update-grub are not required for mint10 or maverick, these were required when using Ubuntu Lucid)

sudo update-initramfs -c -k 2.6.39.1-corei7

and final step of

sudo update-grub

before rebooting and reboot into the newly installed kernel from grub

How to build yourself

follow my blog on how to build kernel in ten steps at


Kernel Source

I downloaded the kernel source tarball from kernel.org

Version: 2.6.39.1

MD5SUMS


a49241f9031cde9edcf11944834f42ad  linux-headers-2.6.39.1-corei7_14.00_amd64.deb
7a737e291d424c7a150e77288d9bece5  linux-image-2.6.39.1-corei7_14.00_amd64.deb
843da30b6058a34d25457cc559b9fba5  Readme.odt
2fd411e9be96b2ecc69f0fbc3d590b99  Readme.pdf
ddb62c9453000f5dd617d97a37f1f353  CONFIG-EL6-UBUNTU

SHA256SUMS


7582e0b6b54d705ac2250daa1ca145d719dddf3e1834c11d37d949098ed7d808  linux-headers-2.6.39.1-corei7_14.00_amd64.deb
6c4ec5432fc850e1d5365a00c896a35d1e11cdd296e8dee373d6b4814a113bdb  linux-image-2.6.39.1-corei7_14.00_amd64.deb
3d8174e91f95503d2c3b6ffc89c91f96cffad715ffcd481227153acf57c9ad44  Readme.odt
1035eb068a70b2c1c32ba279535841a553341ad8910685cb4d4effe9ec302bcb  Readme.pdf
dceeb9d0f561266d7dba314e40054662834ec8056683e54a09accad9c4d0beaa  CONFIG-EL6-UBUNTU

My Personal Experience
With this kernel built with corei7 optimized I see Ubuntu booting in 7 to 9 seconds. corei7 is a new march added from gcc 4.6





I installed gcc 4.6 from ubuntu toolchain test ppa. If you want gcc 4.6 in Ubuntu 11.04 follow this

sudo apt-add-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update


followed by upgrading gcc/g++/binutil packages from synaptic or update manager

With stock Ubuntu 11.04 it used to take 17 to 20 seconds. Also available RAM is more since I built with EL6 as base config. 

17 comments:

  1. Hi,
    installation on 11.04 worked without any problems. It only does not find the fglrx module, and cannot boot into graphical mode.
    Any hint to solve this issue?

    Thanks for support,

    Markus

    ReplyDelete
  2. Boot into default Ubuntu kernel
    Install from Additional Hardware Drivers (fglrx) which should have dkms support
    Reboot into default Ubuntu kernel
    Remove custom kernel 2.6.39.1
    Install custom kernel 2.6.39.1 which should trigger dkms
    Now reboot into 2.6.39.1

    I followed the above for nvidia, not sure if ATI radeon also has similar dkms support, this is just from my nvidia experience, so give a try

    ReplyDelete
  3. Thank you,
    I installed the latest fglrx driver and there the dkms worked fine. Now I am running your kernel.Solved one issue about some boot error message...
    Now I try to solve the issue, that my X needs u tp 50% cpu when maximizing and minimizing a window... god damn.

    ReplyDelete
  4. http://ubuntuforums.org/showthread.php?t=1742724

    ReplyDelete
  5. I guess if you get good X and compiz support with default kernel and fglrx, stick with it. I guess ati drivers are specially released for Ubuntu even before they are out for other linux distros...

    ReplyDelete
  6. Any chance you might have this optimized for core 2 duo? I really appreciate the work you put into this. The power regression bug in the 2.6.37-2.6.39 kernels has really killed my battery life/charge capacity. Apparently, there are improvements in 2.6.39.1 kernel, but I can't seem to compile a kernel that actually works after booting it. I'm happy to see you found a solution to the symlink issue, btw(I'm the anon that commented on that a little while back in a previous post). Given the amount of work you're doing, you really should get more recognition for it (whether on the Ubuntu/Mint forums, WebUpd8, OMGUbuntu, Phoronix, etc.). :)

    ReplyDelete
  7. I will build 64 bit core2 packages with gcc 4.6 with -Ofast optimization and upload the links.

    I am not doing that much work as you tell and just only compiling during my free hours, ;)

    which anyhow my system does when I am browsing, ;)

    ReplyDelete
  8. Hi Anon

    http://duopetalflower.blogspot.com/2011/06/custom-kernel-26391-ubuntu-amd64_23.html

    I have built for core2 with gcc -Ofast, for download links and info browse the above link

    ReplyDelete
  9. Hi, can you please write what you did to fix the i915 turbo boost bug ( https://bugs.launchpad.net/ubuntu/+source/linux/+bug/724569)?

    many people have found your kernel through this bug, but it is not clear what caused it to be fixed.

    Thank you!!

    ReplyDelete
  10. It has to do something with config, I used Enterprise Linux 6 config as base for 2.6.39.1 and for 2.6.38.1 I used lucid config as base.

    ReplyDelete
  11. Worked for my Corei7 laptop, but Ubuntu 11.04 amd64 has problems recognizing my bluetooth mouse afterwards. That works perfectly with your 2.6.38.3 amd64 kernel optimized for corei7. I am using bluez 4.91-0ubuntu1. I googled this link about the same subject
    http://www.spinics.net/lists/linux-bluetooth/msg12421.html
    that maybe would be helpful to solve this issue.

    ReplyDelete
  12. Maybe because I used Enterprise Linux as base config, some configuration is missing, I will build with Ubuntu Maverick kernel config as base

    ReplyDelete
  13. I have followed the link you have given and enabled BT_L2CAP and BT_SCO in kernel config. I am building the kernel with core2 optimization, will upload the updated ones for 2.6.39.2 once done

    ReplyDelete
  14. http://duopetalflower.blogspot.com/2011/06/custom-kernel-26392-ubuntu-amd64.html

    contains details of the same, I have uploaded the kernel 2.6.39.2 with core2 optimizations and Bluetooth built in along with VGA_SWITCHEROO

    Will build with same config for corei7 and post links here

    ReplyDelete
  15. AWESOME now my bluetooth works again as well. thank you sooo much!

    Of course Xorg still tkaes too much CPU load. I hope I can solve this ati problem one day.
    Thanks so much

    ReplyDelete
  16. Can this work with amd phenom 6 core?

    ReplyDelete