Showing posts with label linux-ck. Show all posts
Showing posts with label linux-ck. Show all posts

25 April 2013

395. Compiling the ck-kernel 3.8.x on debian (and patching i915)

What is the ck kernel? In short it is a patch for the mainline kernel which is supposed to render it more responsive for desktop use. See here:

I'm not going to try to 'benchmark' this against the stock kernel, since I'm not clear what a good metric would be -- how do you measure 'responsiveness'? Come to think of it -- what's a good, objective definition?

Download the kernel version that you need from and the ck path from Con's web page at

I also ended up applying this patch to sort out recent i915 issues:

I did it by creating a file called i915.patch and placing it in the kernel source root:
--- drivers/gpu/drm/drm_crtc_helper.c 2013-04-26 10:24:07.987942008 +1000 +++ ../../linux-3.8.8/drivers/gpu/drm/drm_crtc_helper.c 2013-04-17 15:11:28.000000000 +1000 @@ -1067,7 +1067,7 @@ void drm_helper_hpd_irq_event(struct drm enum drm_connector_status old_status; bool changed = false; - if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll) + if (!dev->mode_config.poll_enabled) return; mutex_lock(&dev->mode_config.mutex);
Note that as far as I know it doesn't solve the issue, but it does allow you to disable polling by editing /etc/default/grub and adding
GRUB_CMDLINE_LINUX_DEFAULT="quiet drm_kms_helper.poll=N"
followed by running
sudo update-grub

So far it's working fine (after testing for ca one hour).

Anyway, here's kernel 3.8.5 (should work on all 3.8.x):
sudo apt-get install kernel-package fakeroot build-essential ncurses-dev
mkdir ~/tmp
cd ~/tmp
tar xvf linux-3.8.5.tar.xz
cd linux-3.8.5/
bunzip2 patch-3.8-ck1.bz2
patch -p1 < patch-3.8-ck1
patching file arch/powerpc/platforms/cell/spufs/sched.c patching file Documentation/scheduler/sched-BFS.txt patching file Documentation/sysctl/kernel.txt patching file fs/proc/base.c patching file include/linux/init_task.h patching file include/linux/ioprio.h patching file include/linux/sched.h patching file init/Kconfig patching file init/main.c patching file kernel/delayacct.c patching file kernel/exit.c patching file kernel/posix-cpu-timers.c patching file kernel/sysctl.c patching file lib/Kconfig.debug patching file include/linux/jiffies.h patching file drivers/cpufreq/cpufreq.c patching file drivers/cpufreq/cpufreq_ondemand.c patching file drivers/cpufreq/cpufreq_conservative.c patching file kernel/sched/bfs.c patching file kernel/sched/Makefile patching file include/uapi/linux/sched.h patching file include/linux/swap.h patching file mm/memory.c patching file mm/swapfile.c patching file mm/vmscan.c patching file arch/x86/Kconfig patching file kernel/Kconfig.hz patching file kernel/Kconfig.preempt patching file Makefile
patch -p0 -R < i915.patch
patching file drivers/gpu/drm/drm_crtc_helper.c
make-kpgk clean cat /boot/config-`uname -r`>.config make oldconfig time fakeroot make-kpkg -j4 --initrd kernel_image kernel_headers sudo dpkg -i ../linux*3.8.5-ck*.deb

where 4 is the number of cores on your machine (note: it only has to do with compiling -- you can use the compiled binaries on any number of cores).

That's it. Now all you have to do is reboot and you'll be using your new kernel. Simple, eh?