libvirt “unable to create vcpu group” on linux-ck kernel

I’ve been using Con Kolivas’ linux-ck patch set for a few years now. If you’ve ever asked yourself “It’s 2013, why does my music playback skip when I do too many things on my computer?!” then you probably need to look if your distro has a ck-patched kernel. A large part of the ck patch set is the “Brain Fuck Scheduler” (BFS), a greatly-simplified scheduler of CPU time slices which aims to improve interactivity of the desktop during all sorts of workloads.

Lately I’ve been getting weird errors when trying to start virtual machines managed by libvirt:

# virsh start cm7-ubuntu-12.04.1
error: Failed to start domain cm7-ubuntu-12.04.1
error: Unable to create vcpu cgroup for cm7-ubuntu-12.04.1(vcpu: 0): No such file or directory

As far as I could tell the errors were random; sometimes rebooting helped, etc. I couldn’t understand why until recently when I was reading the comments of some (linux-ck maybe?) Arch Linux User Repository package and then it clicked…

BFS doesn’t support cgroups

It turns out that BFS doesn’t support cgroups, and libvirt relies heavily on cgroups. So you need to run a kernel which supports cgroups if you want to use libvirt. Otherwise just stick to straight KVM or VirtualBox for all your virtualization needs.

It’s not a huge deal for me, I’m really just glad the mystery is solved. Hopefully I’m pleasantly surprised with how mainstream Linux’s default Completely Fair Scheduler (CFS) has come along. 😉

BFS is still cool

In implementing BFS Con removed thousands of lines of code from the Linux kernel’s scheduler implementation, greatly simplifying the scheduling process. The idea behind it is dead simple. As Con explained once, BFS is basically like having one master queue to service several supermarket checkers (as opposed to each checker having his/her own queue). There’s a video explaining this type of queuing theory on YouTube here: Why the other line is likely to move faster.