Hi guys,
I'd like to ask you, if you have any particular tips when (if) you compile your own kernel for your laptop?
As for me, except usual stuff appropriate like selecting the HW drivers and CPU type coresponding with your laptop - I have 2 questions:
1. which cpu governor you use as default?
me:
[root@orionis boot]# cat config-2.6.32.9-r61-0 | grep -i CONFIG_CPU_FREQ_GOV
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
so I've got all govs compiled in and default is 'userspace':
[root@orionis boot]# cat config-2.6.32.9-r61-0 | grep -i CONFIG_CPU_FREQ_DEFAULT_GOV
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
This being said, if i'm on battery only i just switch to conservative:
[root@orionis boot]# cpufreq-selector -g conservative
2. which I/O scheduler you use for the HDD access ?
[root@orionis boot]# cat config-2.6.32.9-r61-0 | grep -i CONFIG_IOSCHED
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
my default is anticipatory (changed that from CFQ):
[root@orionis boot]# cat config-2.6.32.9-r61-0 | grep -i CONFIG_DEFAULT_
CONFIG_DEFAULT_AS=y
# CONFIG_DEFAULT_DEADLINE is not set
# CONFIG_DEFAULT_CFQ is not set
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="anticipatory"
If you ever played with this, did you notice any performance change?
Or if you have any other tips relating to e.g. battery life, or performance kernel tunning for laptop?
I know it's dependant on the HW your laptop is built from, but I'm just curious, so share if you will, even if it's not relevant to my HW (intel) platform ....
nice day to you all
-
Hello,
Just my point of view about parameters you expose, then some others.
About the governor, i use conservative by default. ondemand is a bit more responsive if you wish but also rise freq to the higher level (except IDA) and at last your notebook got warmer.
About Scheduler, i also run on 2.6.32 and since it was deeply re-worker CFQ do a good job with hard drive. But for an ide ssd on another notebook i recently switch back to anticipatory because i got lot of freeze with cfq and now all is fine. Not sure it's related but i talk about experiences i encountered.
Anyway, for both of them, i think it could be better to compile unset (but wished) governor/scheduler as module, free a bit your kernel mem it will thank you
Whatelse, well if ubuntu don't integrate it, consider the linux-phc patch to manage your cpu voltage. Most of time you can expect nice result, system run cooler and battery stay up longer.
If you use your notebook for general purpose, try PREEMPT_VOLUNTARY whereas PREEMPT, last one can degrade conservative job on long time.
I guess if you ask about all of it you already tweaked you kernel a bit, reducing wide counter, remove unneeded feature, enabling powertop trick to track any power loss, proc/sys tune, etc ... if not, and which to get some info, i'll glad to help you.
Last thing, i don't know which window manager you use but if it work well with hal/acpi, you can appreciate to see brightness, peripheral activity, etc, tuned by it.
Regards -
Roscop,
thanks for information!
I think I'm gonna:
- recompile with conservative as default and set rest as modules
- will stay with anticipatory I/O scheduler
Can you a bit explain your note about the preempt_voluntary you mentioned?
my settings is:
[root@orionis boot]# cat config-2.6.32.10-r61-0 | grep -i PREEMPT
# CONFIG_TREE_PREEMPT_RCU is not set
CONFIG_PREEMPT_NOTIFIERS=y
# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set
Also I use tickless system as cpu feature:
#
# Processor type and features
#
CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
# CONFIG_HIGH_RES_TIMERS is not set
Also, I run CentOS 5.4 with kde 3.5, so I use kwin as window manager. I'm just trying to get the best off my laptop, so i switched to non-centos kernel.
Also I've installed laptop-mode-tools:
Installed Packages
Name : laptop-mode-tools
Arch : noarch
Version : 1.32
Release : 1.el5.rf
Size : 182 k
Repo : installed
Summary : Tools to spin down hard disks automatically for power savings
URL : http://www.xs4all.nl/~bsamwel/laptop_mode/tools/
Q:
Anyone here use this tools? Experience? I don't run it by default (started as system service automatically), I run it by hand, when needed, because i'm afraid of the HDD wearing off by spinning it down too much .... -
I don't see a point. The amount of 'speed increase' you get from this will never justify your time spent on tweaking it.
-
You're totally right considering the speed, but i'm curious minded person and by doing so I learn lots things, which is a fair trade for me.
I started compiling kernel for my laptop, because i started to use RHEL 5.x in 2007 on it and wanted support for my wifi and card reader. So, from time to time i just download new kernel and recompile.
-
If you're doing this more for the learning experience rather than the (small) performance benefit, consider LFS (Linux From Scratch).
-
I was previously in the same position trying to compile to get the most speed, but actually the milliseconds improvement doesn't justify the hours of compilation...it just doesn't add up.
Compiling from scratch to understand the system better seems better justified. -
As I've said, I started to compile kernel because of my laptop HW was not supported in original RHEL 5.x. Since my laptop is already older, the drivers were already backported to original native RHEL kernel. But I simply like it to see myself 'behind' the desktop surface and see new things in kernel - just testing a little brtfs now
.
Also, I work with RHEL servers, so having it on laptop (CentOS) helps me a lot with my job - otherwise i'd probably go for 'newer' distribution at the time.
And the compilation itself takes roughly 20 minutes on my ntb and with usage of previous kernel config the work itself is done in 'no time' so 'hours compilation' is not my case. -
Sorry for being late to the thread..
Well as most tinkerers do, I tend to like these kinds of discussions and system tweaking. Not for any single performance boost, although collectively they can add up to an impressive overall improvement, but as has been mentioned, it's cool to learn more about the inner workings of your OS. You might be surprised what you discover.
In the end, picking the right I/O scheduler is important. The other thing to note is that with the 2.6.33 version of the Linux kernel, the anticipatory scheduler will be removed. You might want to test out CFQ, (if you're using standard HDDs), and see if it works as well for you, in anticipation of the upcoming change. BTW, for anyone who wants a good read on Linux I/O schedulers in general, this is a good article.
Processor type and features --->
Preemption Model --->
I selected Preemtible Kernel (Low-Latency Desktop)
and
Processor type and features --->
Timer frequency --->
I selected 300 Hz
This did improve my system responsiveness and performance overall, but I believe this is highly dependent on the laptop hardware. The general suggestion is to try each option, and see if you experience a system improvement. If not, then change your kernel settings back. This is a good article on preemption and the Linux kernel, and this is another performance related thread over at the Gentoo User Forums which makes for some interesting reading on Linux kernel 2.6 performance tweaks in general.
Lastly, I believe it's an often overlooked tweak, which I was reminded of when I changed to SSDs and I read Dan Weinreb's aforementioned blog post, but a big system performance tweak, available to everyone, for sometimes little additional investment, is to overload your laptop with RAM and setup a RAM disk for your temporary files. Not only system tmp directories, but web browser temp files, and anything else you can think of that you don't need persistently. For my system, (Gentoo), I put 8GB of memory in my laptop, and moved not only /tmp to my newly created 4GB RAM disk, but also my portage tmpdir to RAM disk as well. I also configured my system to compile my kernels on the RAM disk. So while this was obviously done to save wear and tear on my SSD, it's also blazing fast to do most any compilations now, as they are completely done in RAM.
As a matter of fact the only compilation I can't do in this RAM disk is OpenOffice, (yes, I compile it from source and you need about 6gb free disk space), but after moving to an SSD, my compile time when from 3 hours to 1 hour. So for my money an SSD is the single biggest performance improvement anyone can make in their system. It's just not cost effective right now, especially when you compare a standard SATA HDD to a SATA SSD, for price/space.
Anyway.. -
Great post Jas, thanks, +rep
customizing kernel for notebook - do you have any tips?
Discussion in 'Linux Compatibility and Software' started by helikaon, Mar 16, 2010.