Linux kernel: The battle of the CPU schedulers

Since some time already, different patches are being written for the Linux kernel, which improve the CPU scheduler. The CPU scheduler, is that part of the kernel, that’s responsible for assigning CPU time to the different task running on your system. If you sometimes experience problems with sound stuttering or your mouse becoming jerky while running other CPU intensive tasks, then this is definitely a problem caused by the task scheduler.

Con Kolivas has been maintaining an alternative scheduler for some time. His Staircase scheduler was designed with interactivity in mind, especially for desktop systems, where people want their system to be quickly responsive under all kinds of workloads. This scheduler has been optimized a lot through the years, and as such is very stable. Still there are some rare cases where “starvation” is possible.

At the start of March, Con Kolivas published a new scheduler, which was called RSDL (Rotating Staircase DeadLine scheduler) at first, and has been renamed to SD (Staircase Deadline) afterwards. Based on the experience Con Kolivas gathered with his Staircase scheduler, SD is a more general purpose scheduler, trying to give absolute fairness to the different running tasks, without favouring any process (for example lots of other schedulers favour X). This way, no starvation issues should be possible with this scheduler. A lot of discussion followed after his announcement, and it became quickly clear that a lot of people were not happy with the current scheduler in Linux. Important kernel developers like Mike Galbraith, Nick Piggin, Ingo Molnar, Willy Tarreau and Andrew Morton joined the discussion and also posted other scheduler patches, sometimes not without some trolling and flaming as sometimes happen on such mailing lists. Con Kolivas’ scheduler was added to Andrew Morton’s mm kernel tree to get some more testing. The development of RDSL/SD went up and down sometimes, because of Con Kolivas’ health problems.

Ingo Molnar, which was rather critical of some of the ideas in the new scheduler at first, also recently began the development of CFS (Completely Fair Scheduler, which actually is based on the same basic concept of fairness. Con Kolivas announced that he would stop development of the RD scheduler, because of his health problems, and because his ideas would now continue to be used in the CFS scheduler. But things came out differently, and Con Kolivas continued development in the end. The result is that the SD scheduler is now at its 46’th version (v. 0.46), and it seems most problems have been fixed. Based on all the testing done on the kernel mailing list, it seems SD 0.46 is more mature than CFS 6. Even Willy Tarreau, maintainer of the 2.4 Linux kernel tree, said that thanks to SD, he did make Linux 2.6 the default kernel on his laptop, as he found the scheduler in mainline 2.6 too bad compared to 2.4. It’s unclear however which of these schedulers will be integrated in linux finally, and when this will happen.

Personally I think SD 0.46 should be integrated now in Linux 2.6.22 pre-releases. There has been a lot of testing and bug fixing, and it seems there are no serious bugs open anymore now. I also hope that Mandriva 2008 will come out with one of these new schedulers. The tmb kernel in Mandriva Cooker, already uses the SD scheduler now. People interested in this discussion, can subscribe to the ck mailing list where a lot of the discussion is happening. Sites like LWN.net and Kerneltrap also often post about the progress of this subject.

Testing KDE video players, setting up backups and a cluster, cleaning up poppler and sqlite stuff

Today I tried Kaffeine 0.8.4 with XCB support. It is supposed to fix the stability issues when playing embedded videos in Konqueror, so I wanted to verify if it is a real contender to KMPlayer. Kaffeine indeed does not seem to cause instabilities in Konqueror anymore. That’s good. I tried viewing videos on vrtnieuws.net and this worked fine. Unfortunately, trying to view an Apple movie trailer failed, while KMPlayer (with mplayer back-end) worked fine. When double clicking on local video files while browsing system:/home in Konqueror, Kaffeine still copies the whole file to a temporary directory. Actually the default use of system:/home instead of /home/login by Konqueror is completely braindead, but I do not understand why Kaffeine needs to copy the whole file, while KMplayer does not need to do this. So for now, I still recommend KMPlayer.

At work, I started to install a cluster system, consisting of about 6 (IIRC) computers. I will try Kerrighed on Debian Etch. It seems an interesting project: more actively developed than OpenMosix with a clear roadmap for the future. And it does not seem too difficult to install. I’ll post my experiences soon.

Also at work, I recently discovered the rdiff-backup and backupninja projects. These programs really rule for making backups on free hard drive space. For tape back-ups I like Bacula, but it is not that easy to configure. For simple backups on hard drives, nothing beats the simplicity of rdiff-backup and backupninja. I should definitely check whether these good backuptools are also included in the Mandriva repositories.

Some things I have on my personal TODO list: I want to find out which programs still depend on xpdf, or have their proper xpdf code included in the source. We should maximise the use of poppler instead, because it is a shared library. If all PDF programs use poppler, all programs will easily benefit from improvements to poppler. And it will make security updates for all these programs much easier. And we will gain some space, which is always interesting for the One live CDs. Because now, a lot of packages have to be separately updated which is a PITA. I would like to do the same for sqlite. Seems like a lot of packages still depend on the old sqlite 2 instead of the more modern version 3, and some programs still use their own private copy. Let’s hunt these packages down, and see if we can compile them with the sqlite 3 shared library. If not, bug reports should be opened upstream so this gets fixed.

Why I do not like Apple computers and Mac OS X

Since a few months, I got an Apple Powerbook Pro from my employer. It’s not one of those new Intel based machines, but it still has a G4 1.5 Ghz PowerPC processor, and 1 GB of RAM and it runs Mac OX 10.4 Tiger. This is my first Mac. Before, I always worked with DOS, Windows and Linux.

Mac fans always say it’s the best and most intuitive OS on the market today. I do not agree with this opinion at all, as I found some things in Mac OS X very unintuitive compared to Windows, KDE and Gnome desktops.

Let’s take for example the dock. When you have several instances of the same application open (e.g. different terminal windows), you have to click for a second on the icon, to get the list of all open instances. I only discovered this by accident. I think the Windows, KDE and Gnome way, to automatically show the list of open instances when you click normally on the item in the taskbar, is much more natural. I have the impression that Exposé is actually only a “hack” to fix this unintuiveness: actually, in KDE and Gnome I never felt the need for somethiing like Exposé, and I do not miss it at all when I’m back in Linux from a Mac OS X session.

About Exposé itself: actually it was not intuitive to find. I had to search on the web to actually learn how I could activate it. If I had never read about it before on the Internet, maybe I would not even have discovered it. Same with the show desktop functonality, which was much harder to find that in KDE and Gnome, which have a visible button on the panel to activate it. Another functionality which I often use in KDE and Gnome is locking my session. Again, I had to search on the web how I could get a similar functionality in Mac OS X, as there is no such option in the menus.

When you close certain application windows, the window is closed, but the application stays active in memory, and are not remove from the dock. To close them completely, you have to close them by using the top level menu. I think this is strange too, as people could be surprised that over some time, their system becomes slower and slower, because applications they started once, are still eating up memory.

Typical Mac OS X browsers (Safari and Camino) have the habbit of saving all files (such as PDF files) on the desktop. It’s extremely annoying, because after an hour of web browsing, my desktop is cluttered with files which do not interest my anymore. And did you know that tabbed browsing in Safari, is actually a configurable option, which is disactivated by default?

Installing software is sometimes confusing too. Sometimes you get a real installer program like you have in Windows, where you choose the drive where you want to install, and several options. Other times, you get an image which contains the application which you just have to drag to the Applications folder. And sometimes it contains a complete directory, which has to be dragged to Applications. Especially the difference between these last two cases is not always clear. I already ended up just copying the application executable, while in fact I had to copy the whole directory to Applications. And in the beginning, I just had the downloaded image file on my desktop and started the application from the mounted image. I did not even know that I had to copy it to drag the executable file to Applications.

Actually I think Mac OS X also lacks a nice application menu. Most of the time, I end up starting applications by typing their name in Spotlight or Quicksilver (which of course means you have to know the application’s name first), but then again I prefer just browsing a standard, well structured application menu like in KDE and Gnome. I see the fact that things like Spotlight and QuickSilver are must haves to launch applications in Mac OS X, as a proof that things are not that well organised by default.

And what annoys me the most of all: the keyboard. Apple keyboards use a lay-out which is not completely the same as normal PC keyboards. Especially the Belgian keyboards are a disaster. A lot of special characters used in a console (for example: { } | @ ^ [ ] ~ ), have to be called with the Alt-Gr key on normal Belgian PC keyboards. Most of these characters, do not even appear at all on a Belgian Apple keyboard! To type a | on a Belgian Apple keyboard, you have to type Ctrl+Alt+l. {, [, } and ] can also be typed with some key combinations with Ctrl, Alt ( and ). And the ~? I don’t even know yet how to type this one. The keyboard on my Powerbook does not have a Delete key, it only has a Backspace key. And I learned that in my preferred shell (which is iTerm, as the default Apple Terminal does not seem to have tabs), it sometimes worked as a Delete key instead of a Backspace key. With some Googling, I could change this. Another problem in iTerm was that the Alt key was not working like I expected in irssi, so again I had to google how to change that. And now the best of all: since I fixed the behaviour of the Alt key for irssi, the special combinations like Ctrl-Alt-l to get the pipe symbol | does not work anymore in iTerm! *Sigh*… And knowing that on a normal PC (either Windows or Linux) all this works out of the box without any configuration…

So most of the time I use Linux on my Apple machine where I have configured my keyboard as a classic PC keyboard (also not a perfect solution, as I have to type all these special characters blind now). Unfortunately not a lot of distributions do support PowerPC anymore these days, such as my preferred distro Mandriva. I installed Ubuntu, but only shortly after my installation, Ubuntu also decided not to officially support PowerPC anymore. It will continue to live as long as the community maintains it. I guess Debian will be my best bet in the future…

smb4k, Amarok and Kontact

I was having fun with some upstream problems tonight.

First, I reported the two issues I had encountered earlier when testing smb4k: it still uses the deprecated smbfs instead of cifs by default, and it does not get the right character set from your locale settings.

Another problem which annoyed me already for some time: when I put new files in the directory defined in my Amarok collection, they did not show up. I asked about the problem on Amarok’s IRC channel, and eeanm helped finding me the real culprit. My files are on a seperate file system, mounted as /mnt/Music. Apparently, Amarok uses the directory’s modification time to detect changes, but when you change something in /mnt/Music, the modification time of the directory Music apparently does not change when it’s a mount point. When you put something in a subdirectory of the mount point, it should work. And I was using the noatime mount option on the XFS file system. I removed that, and then when putting a file in a subdirectory of /mnt/Music, Amarok detected the file automagically! Thanks eeanm!

And another disturbing problem: Kontact (well, actually KMail) is unstable on IMAP. It has always been like that. In the latest versions, it became more stable, but I still have it occasionally hanging when opening an IMAP folder (changing folders is enough to fix this), or an occasional crash. Unfortunately the backtraces are unusable, for example:

0x00002afc8171c2e1 in nanosleep () from /lib64/libc.so.6
#0  0x00002afc8171c2e1 in nanosleep () from /lib64/libc.so.6
#1  0x00002afc8171c0e9 in sleep () from /lib64/libc.so.6
#2  0x00002afc7ca649bc in KCrash::startDrKonqi ()
   from /usr/lib64/libkdecore.so.4
#3  0x00002afc7ca77c34 in KCrash::defaultCrashHandler ()
   from /usr/lib64/libkdecore.so.4
#4  0x00002afc816b6da0 in QWidget::setUpdatesEnabled () from /lib64/libc.so.6
#5  0x0000000000000000 in ?? ()

These kind of occasional, apparently random crashes, are the reason why we need something like apport.

Anyway, it’s a known problem that IMAP and KMail do not go well together. Some SuSE developers finally started taking a look at the various IMAP problems in KMail. Unfortunately, too late for Mandriva 2007.1 :-(

Instead Mandriva KDE maintainers decided to focus on KDE 4, but IMO this was much too early, and I would be surprised if KDE 4 will really be stable and feature complete enough to have it as default in 2008.0. Fortunately, several of my earlier reported KDE problems are fixed now, but other problems still seem to be ignored completely without any clear reason. Oh well, I’ve reported them, and I decided not to continue restating these issues again and again; I’m a bit tired of it. I’ll wait for final release now, and then start focussing on suggesting improvements for Mandriva 2008.

Dell to offer pre-installed Linux computers soon

It seems that Dell is actively working now on a selection of computers pre-installed with Linux. They were already offering Linux on selected servers and workstations, but now some desktop and laptop models will become available too. They did not decide yet which distributions they will support, but they seem to be following the healthy principle that the distribution is not the most important thing, but rather hardware support by free software drivers included in the upstream kernel is what users want. That means that the hardware will work out of the box in any distribution. Let’s hope their efforts will be rewarded by the community, and that other manufacturers will follow soon. It will strengthen the pressure on all kind of computer parts manufacturers to make sure their boards are supported by Linux.

Seeing how much people in my environment are starting to talk about Linux, that there is always a delegation promoting Linux (Unfortunately Ubuntu centric) on most computer fairs in Belgium, that sometimes I see random people in the train using Linux, gives me the confidence that Linux is here to stay, and actually is already becoming mainstream!

Frugalware – Yet another new distribution

Bah, I just typed a small review of Frugalware, a new distribution based on Slackware, but I lost the text, probably because I hit the maximum session time of my blog system :-( That will learn me to save the text from time to time.

I won’t retype it completely. But to summarize: Frugalware could be an interesting alternative for Slackware fans, as it contains much more packages than Slackware, and is much more actively developed. But for users wanting a nice distribution without too much effort: forget about Frugalware. The installer is extremely cumbersome. It did not give any error message when the installation of the boot loader failed, and when it did, the kernel did not succeed in mounting the root partition in a VMWare system. So actually I never got to test the distribution itself. Oh, and the default software selection is unhandy, and too much things are installed by default (default install includes KDE + Gnome + XFCE + server tools +advanced console tools for experienced users and other things).

Trying out Epiphany

During the past week, I have tried out the Epiphany web browser as an alternative for Firefox. Long ago, I already tested it, but I did not like it, as it lacked too many features I wanted. But Epiphany has evolved a lot in the meantime, so it was worthwhile to evaluate it again. The version I tested was 2.18, as available in Mandriva Cooker and Ubuntu Feisty.

I’ll quickly note the most important points I remarked:

  • Nice Gnome interface: Epiphany’s interface is very beautiful in Gnome. It uses the same theme and toolbar settings from Gnome (I have set toolbars to show text next to the icon). Epihpany looks much nicer than Mandriva’s hacked Firefox theme.
  • Clean Preferences dialog: Epiphany’s Preferences dialog is very clean with only 4 tabs and not too much options per tab. Again a huge different with Firefox’ Preferences dialog, which has 7 categories, of which most of them have several tabs and/or buttons for other dialogs where you can configure things. In Epiphany, settings are taken from global Gnome configuration if possible (for example proxy settings).
  • Easy Adblock extension: Epiphany comes by default with some extensions, of which Adblock is one. Its configuration is very easy: you only have to enable it, and it will automatically use the Filterset.G Adblock rules. There’s no need to manually install and configure the extension as is the case in Firefox.
  • Tag based bookmarking: Instead of storing all bookmarks in a hierarchical list like Firefox does, Epiphany lets you define tags for bookmarks. This way, you can easily find bookmarks based on these tags. It’s much handier than the hierarchical list, as its easier to to find a particular bookmark if you have lots of bookmarks defined. Also a nice feature is that when you type a word in the URL bar, it will show you all bookmarks which have this word in its title.
  • No Flashblock extension: One of the extensions I really like a lot in Firefox, is the Flashblock extension. I don’t like Flash: it is often used for commercials or useless intro’s, often contain annoying sounds, and it simply does not work good in Linux. Try for example the webiste of the Belgian radio station Radio Donna. In Linux, the pop-up menus on the left, will always be shown under the Flash animations, which makes navigating this site impossible. For all this reasons, I use the Flashblock extension, so that I can decide myself whether I want to view the Flash animation or not. Unfortunately such a functionality is not integrated in Epiphany. I found a way to have the same functionality by modifying the user style sheet. Still, this functionality should be integrated in Epiphany, like Adblock, so user’s don’t have to fiddle with such advanced settings. Even Camino for Mac OS X has it integrated now.
  • Downloads and opens files by default: When you click on a download link, Epiphany will automatically download the file to your desktop, and open it in the default Gnome application for that file type. I did not like this functionality at all: after a few hours of browsing, I had my desktop cluttered with PDF and other files which I looked at briefly while browsing the web, but did not want to save. Fortunately, you can disable this behaviour, and then Epiphany will ask if you want to open or download a file and where you want to save it.
  • Problematic font configuration: I tried out Epiphany on different systems, and on all of them, I had problems with font handling. By default, the font settings are different than Firefox. On a lot of sites, by default the fonts were smaller than in Firefox. This problem can easily be seen by opening sites as LWN.net, vrtnieuws.net and the GMail home page in both Firefox and Epiphany. When changing the font settings in Edit – Preferences – Fonts & Style, I remarked some strange problems: for some reason, the minimum size in the global font settings, was not synchronized with the minimum size under the “Detailed font settings” dialog. The default font sizes are set to 12 points. When setting it to 13 points, I noticed that fonts became much bigger, and when going back to 12 points, actually, the fonts were still bigger than they were with the default settings! I also had the impression that when changing the font size, it was sometimes best to restart the web browser, as results seemed to be different than before restart of Epiphany. In the end on all of my systems, I had to spend a lot of time finding out the best font settings which looked reasonable on all sites. I remember I have changed the minimum font size in Firefox, but apart from that, fonts were perfectly OK by default in Firefox for me.
  • No download manager: When a file is downloaded, there is briefly some kind of download manager displayed where you can track progress, but after the download has finished, this dialog disappears automatically, and there does not seem to be a way to show it again. I find this very annoying, as this means I have to start Nautilus to navigate to the file to open it. And, like a lot of people, it sometimes happens to me that I do not pay a lot of attention to the location were I save the file. In Firefox I can look up the location in the Downloads dialog, but in Epiphany, I have to hunt down the file by hand. I suppose this functionality has got a lot less attention than in Firefox, because you are supposed to let Epiphany download all files automatically to your desktop…
  • Limited pop-up blocking: By default, Epiphany does not block pop-ups. I do not understand this choice as most competitors use this functionality by default now. The pop-up blocker is a lot more limited than the one you can find in Firefox or Internet Explorer. When a pop-up is blocked, only a small icon appears in the status bar, and I did not see a possibility to open a blocked pop-up, or put a web site on a white list. For example when clicking on the (Flash) link “Webcam” on the Studio Brussel website, I can open the pop-up by clicking on the button in the notification bar in Firefox. In Epiphany, the only way to view this pop-up, is by completely disabling the pop-up blocker in Epiphany’s preferences.
  • Annoying security warnings for broken certificates: When I try to visit the Mandriva Bugzilla by https, I get three different pop-ups warning for all sorts of problems: one that the certificate expired, a second one that the hostname is not correct, and a third one that some parts of the page are send over an insecure connection. When logging in, there is again a security warning that the information is send over an unencrypted connection. Of course these problems are actually caused on the server side, but still, Epiphany should try to collect all problems first, and show them in a single information dialog. The current pop-up flood is very annoying, and this does not encourage users to actually read and interpret all this information correctly. Maybe a supplementary notification bar with the message that some elements will be send over an insecure connection, seems an interesting addition to remind users of the problem, even when they clicked away the warning dialog.
  • No Greasemonkey script manager: One of the extensions I use in Firefox, is the slashdotter extension. It adds Coral Cache links to all links in Slashdot articles, which can be handy if a site is slashdotted. I suppose I can get similar functionality with this Greasemonkey script in Epiphany and tried to install it. After right clicking on the install button and choosing “Install user script”, I got a message that the script was installed correctly. Unfortunately, I did not see the links on the Slashdot website after that (could be a problem in the script itself too I suppose, I did not check this). I wanted to verify if the script was indeed installed, and remove it eventually, but I did not find any functionality in Epiphany to do this. Note: I have never used Greasemonkey in Firefox as I did not need it, so maybe I have wrong expectations.
  • No anti-phishing filter: As far as I can tell, Epiphany does not have an anti-phishing filter, like both Internet Explorer and Firefox have now. While I don’t care about this functionality for myself, I think it’s a useful addition for less experienced users
  • Does not use Gnome’s Keyring: Gnome now has a keyring manager, which stores all passwords in a centralized, eventually password protected, location. It seems not a lot of programs are using this functionality yet. I hope Epiphany will in the near future.

These are the most important points I noticed while using Epiphany. Last Saturday, I experienced four crashes in Epiphany, but after that Epiphany was stable during the whole week. Maybe a bug in the version of cairo (1.4.0) I had installed at that time or in nspluginwrapper on amd64 were involved in these crashes.

All in all, I have to say I liked Epiphany. Still, I think there are too much small features I miss, and this makes I’ll probably start using Firefox again for now. I’ll be following Epiphany’s development more closely though, and I hope that in the near future, I will be able to switch over completely. Having a perfectly integrated browser in Gnome, is really a must have feature.

Please also read this related blog article by developer Luis Villa where he explains why he prefers Epiphany to Firefox.

Blog state

I only started blogging one week ago, but a lot has happened already in the meantime. I had already plans for setting up a blog for some time, and had installed Serendipity a few weeks ago. Why Serendipity and not the more popular WordPress? Well, it was not a very rational decision. I remember a few years ago I was watching statistics by the CIA bot. Serendipity was at that moment one of the most active projects over there. I did a quick install on some test machine, and it seemed nice. And a few weeks ago, because I remembered that, I started looking at Serendipity again. It seemed to have all features I wanted (for example multilingual posts), so I decided to use it. Unfortunately, I discovered already several bugs (especially in the multilingual plug-in), so some work is still needed to get it in a perfect state.

My first post with the review of Gnome audio CD burning applications was a big success actually. Several other sites linked to it, and my posts are now appearing on Planet Mandriva. And probably the most important news: Mandriva now uses Serpentine as its default Gnome audio CD writing application!

So what’s next? Well, I’m currently trying out the Epiphany web browser. I’ll surely write about my experience soon here!