Normally I do not care much about desktop - performance, since my servers do not run any gui. But at home I run some older hardware (Pentium) which gets sometimes very sluggish (mouse-movements in KDE). I observe that this is the case where there is some disk-io background activity going on.

How can I set that disk-priority lower, so that my gui gets more attention?

I already tried to set the disk-scheduler for my sata-drive from cfq to as - but that did not help.

I remember that I had - long time ago - a similar problem on OpenSuSE - there I set a different general scheduler tick-rate (shorter as default, as far as I remember). But I do not remember what that was exactly, neither how to set that on my current Linux (CentOS 5, 32-Bit).

5 Answers
5

Do you have a kernel >= 2.6.38? If not, you may want to upgrade your kernel, so it includes "The ~200 Line Linux Kernel Patch That Does Wonders". This patch drastically increases the responsiveness of the Linux desktop. Since this patch was introduced, the only time my desktop was slow was when it was swapping, as Mikko Rantalainen pointed out, even with recent versions of X.

CentOS5 is a 2.6.18 kernel. But the idea behind this is clever. Perhaps I can achieve the same by building a cpuset for one logical CPU and bind certain processes to it...
–
NilsJun 29 '12 at 20:09

Hmm, that's a possibility, though I suspect compiling your own kernel from kernel.org would be easier. 2.6.18 is quite old already, lots of improvements have been made since, under which many performance improvements. If you are not familiar with compiling a kernel, I can recommend you to check out the kernel compiling chapter from the Gentoo handbook, which pretty much applies to any distro (I would link it, but I only have access to a low-end smartphone atm). You can also make many small performance tweaks this way, by optimizing the kernel for your specific pc.
–
SharkWipfJul 1 '12 at 0:26

I was used to compile kernels when I was younger. Now I think it is not worth the time doing so. I used taskset to pin the system processes with higher PID to one logical CPU, while pinning my user processes to the other logical CPU. Then I was able to pin down the culprit: Firefox is eating my CPU from time to time. Since you got me on that track - you get the accepted answer for this.
–
NilsJul 17 '12 at 20:55

Ulatency is a daemon that controls how the Linux kernel will spend it's
resources on the running processes. It uses dynamic cgroups to give the kernel
hints and limitations on processes.
[...]

== What tries it to fix ==

The Linux scheduler does a pretty good job to give the available resources to
all processes, but this may not be the best user experience in the desktop case. ulatencyd monitors the system and categorizes the running processes into cgroups.
Processes that run wild to slow down the system by causing massive swaping will
be isolated.

If I remember correctly, it in part uses (io)nice underneath. I've never tried it, but if it keeps its promises, it might help you.

I think I changed the number of millisecondy spent for each subtask - from 1000 to 500. Since my "old" Pentium HT 3 GHz processor is most of the time idle I would expect it to work without multi-cores.
–
NilsMay 21 '12 at 13:48

Are you sure your system is not swapping? Older versions of X suffered from getting mouse driver swapped out in case system was swapping (I don't understand why but kernel heuristics often decided that the page containing X mouse driver was a good candidate for swapping and next time you move your mouse, the cursor moved only after the page was swapped back in). Newer versions of X lock the mouse driver to memory and do not suffer from this issue.

No swap issue here. Although old I equipped the machine with plenty of RAM (for its time) - i.e. 2 GB. top shows more than 1 GB as free, swap-usage is zero. And it is not only the mouse that gets stuck. Keypresses are also repeated without end. Your disk-tuning link looks very interesting.
–
NilsJun 29 '12 at 20:17

For what it's worth, I recently went from the standard kernel in Ubunto 3.0.16
to the low latency kernel and the change to my desktop performance was phenomenal.
It took some doing because the Nvidia driver included in the Ubuntu distribution would not load with the low-latency kernel however the exact same driver version
from Nvidia's website worked fine. Rarely but occasionally I used to have WinAmp (under Wine) skip, no more with the new kernel, and switching virtual desktops is instantaneous now.