The benefit of the 4BSD scheduler is, it's drop dead simple. It's like 100 lines of code and 40 of them are comments [...] The 4BSD scheduler works very well for small embedded systems, anything up to about 4 CPUs, you just don't need the complexity that comes from ULE but, as soon as you come over 4 CPUs, ULE is just the winning strategy. […]
[Q]: For a system like the Raspberry Pi with 4 cores 4BSD might be good?
[A]: It's certainly worth trying. [...] It is pretty evident that it's either going to work well for you or it's not. For many many years, people that were doing embedded systems just, they wanted a small footprint in the kernel and certainly 4BSD is a much smaller footprint scheduler than, than ULE is.
I actually, when I gave the version of this talk at BSD Can, I had an hour, so I actually discuss a paper that was written that appeared in a USENIX conference where they compared the schedulers of Linux versus FreeBSD. And one of the data points was, you know 4BSD scheduler is a 100 lines of code, the ULE scheduler is 2000 lines of code, the Linux scheduler is 20000 lines of code. So you know, right there you can sort of see the scaling of complexity. It was kind of an interesting paper and I do recommend it, or you can go back and look at this BSD Can where I talk about this for the better part of 10 or 15 minutes. But the way they did the comparison is that they went into Linux and they removed the Linux scheduler and put ULE in its place. [...] and as they pointed out, it was easier to put ULE into Linux than to put the Linux scheduler into FreeBSD, because ULE is so much smaller and compact.
Anyway, the bottom line is that for the most part the two schedulers do about the same. There are a few cases where Linux does dramatically better, there's a few more cases where FreeBSD does dramatically better. The real issue is that the Linux scheduler has gazillions of special cases in it to deal with certain workloads. And every now and then you get a workload where the Linux scheduler misgauges, what, whether it's a special case and so it slips into using a special case which is a distinct bad choice. So they end up having somewhere, they’re just really bad, whereas ULE, it does have one where it doesn’t do as well as Linux, mostly because Linux has a special case code for that workload but, it doesn’t have any that are just horrible.