Linux

Failed to submit batch buffer (Xorg)

Another Xorg update…

After my last Xorg update I’ve lost the nice ability to log into my KDE. Well, this *sucks* because I spent a long time compiling kdelibs and friends so I really want to use it.

Symptoms

A blank screen on login. You can even see your mouse pointer but nothing else.

If you take a look at the Xorg log you’ll see X is mad about a “batch buffer thingie”.

Error in /var/log/Xorg.0.log:
(EE) intel(0): Failed to submit batch buffer, expect rendering corruption or even a frozen display: No such device

The Solution

Pretty ease to solve this one. Either upgrade your kernel to something like 2.6.36 or better (recommended) or block xf86-video-intel>2.14.

Permanent solution
Upgrade your kernel. I was running an old 2.6.32-tuxonice-r7. Upgraded to 2.6.36 and… Welcome back, KDE.

# emerge --sync && emerge --update gentoo-sources

Workaround (if you’re in a hurry)
Add this to /etc/portage/package.mask

>=x11-drivers/xf86-video-intel-2.14.0

and recompile.

# emerge --update x11-drivers/xf86-video-intel

Don't let updatedb take your Linux down

Coffee break everyone?

Everyday morning was the same: updatedb came and took my Gentoo away. The symptoms were clear, X/KDE applications starting to become slow and unresponsive, and then the two inevitable choices: go for a coffee and wait or pkill the bastard.

Asking updatedb to be nice (the wrong way)

To fix this came to my mind the nice command. This is well known to Gentoo users because of the PORTAGE_NICENESS feature include in make.conf. Nice is a program that adjusts the process scheduling (aka niceness) of the desired programs so setting a value of 19 (the maximum) would make updatedb to be “nicer” to other applications and therefore being less bossy. So I’ve edited /etc/cron.daily/slocate, placed “nice -n 19″ before the updatedb command and waited. But, once again, updatedb came and owned my computer.

Asking updatedb to be I/O-nice (the right way)

So. what’s wrong here? Updatedb is not a CPU-intensive application so nice won’t change a thing. The bottleneck is disk access so what we need here is a nice for I/O. The solution? Ionice.

Ionice is able to set the I/O scheduling class and priority for a given program. To give updatedb a low priority we pick the class 3, the idle one.

Again, let’s go to crontab and edit the slocate entry.

# vim /etc/cron.daily/slocate

Put ionice -c 3 before the updatedb command.

#! /bin/sh

if [ -x /usr/bin/updatedb ]
then
        if [ -f /etc/updatedb.conf ]
        then
                ionice -c 3 /usr/bin/updatedb
        else
                ionice -c 3 /usr/bin/updatedb -f proc
        fi
fi

And if you’re asking where (in Gentoo) is this ionice program, the solution is sys-apps/util-linux, which I’m pretty sure is already installed. If not: emerge -a sys-apps/util-linux.

This is all good but… what’s this updatedb thing?

Updatedb is a tool ran daily by cron to update the slocate database. And Slocate (Secure Locate) is a security enhanced version of the GNU Locate, which is used to index all the files of your system allowing a (very) quick search of them. In Gentoo Linux the slocate is available in Portage through sys-apps/slocate.