📜 ⬆️ ⬇️

Brain Fuck Scheduler - set in 5 minutes

About the new task scheduler for Linux on Habré already written here . A very startling "trailer" with xkcd to a new scheduler, and a no less fun FAQ, awakened interest. I asked friends who put in order to share my impressions - no one put it, because “put a new core into the core” or “I will wait until it appears in the mainstream”. I installed it and tried it myself, and for those who want to do the same, a quick guide for Ubuntu 9.04, with a description of potential rakes.

As a teaser, I can only say that the full-screen video on youtube really does not slow down and the system has become more responsive and faster.

So, in order not to be unfounded, let's start. It is assumed that you have Ubuntu 9.04 (Jaunty) installed.
')

Core


This scheduler is written for 2.6.30+ kernels, so the default 2.6.28 kernel in Jaunty does not suit us. You need to download 2.6.30 , and the latest is better from the branch at the moment - 2.6.30.5 .

Download the sources carefully packed into .deb by the Ubuntu developers:
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30.5/linux-source-2.6.30_2.6.30-02063005_all.deb

Install the source:
sudo dpkg -i linux-source-2.6.30_2.6.30-02063005_all.deb
cd /usr/src
sudo tar xvjf linux-source-2.6.30.tar.bz2


With the core so far finished.

BFS Patch


Now you need to install BrainFuck Scheduler patch. The directory with the patch and other relevant files is here: ck.kolivas.org/patches/bfs
The latest actual version of the patch at the time of writing 2.0.9 - ck.kolivas.org/patches/bfs/2.6.30-sched-bfs-209.patch

Download and apply the patch:
cd /usr/src/linux-source-2.6.30/
sudo wget http://ck.kolivas.org/patches/bfs/2.6.30-sched-bfs-209.patch
sudo patch -p1 < 2.6.30-sched-bfs-209.patch

The patch will swear twice on “assume reverse patch” - you need to answer “no”, and “Apply anyway?” - “yes”.

Build the patched kernel


Now we collect, as always. Whoever doesn’t know how to build always, a brief introduction - in Debian / Ubuntu, there is a handy kernel-package utility for building a kernel that does a ton of work for us. Therefore, we first install it, or make sure that it (and several other necessary programs) are installed:
sudo apt-get install kernel-package libncurses5-dev fakeroot wget bzip2

Now we generate a new kernel configuration based on the existing one:
sudo cp /boot/config-`uname -r` ./.config
sudo make menuconfig

Here we will need to make a couple of changes.

UPD . Correction by coldFlame - these changes are not necessary, moreover, on laptops are not recommended. From FAQ
THESE ARE OPTIONAL FOR LOWEST LATENCY. YOU DO NOT NEED THESE!
Configure your kernel with 1000Hz, preempt ON and disable dynamic ticks.


Exit and save the configuration.

Next, the assembly itself. About 5 minutes in the title, I, of course, lied :), but if the assembly step is neglected (resigned), and let the download speed of the above-mentioned packages strive to infinity, then in 5 minutes we calmly keep within. :)
sudo make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-bfuck kernel_image kernel_headers


If everything went well, then in / usr / src / you will have two .deb packages, with file headers and directly with the kernel and modules. Install them:
sudo dpkg -i /usr/src/*bfuck*.deb

At the same time, the kernel and modules will be installed into the system, a new initrd will be generated, dependent external modules will be rebuilt (except nvidia, but more on that below) and grub will automatically find out about the new kernel.

Everything, it is possible to reboot.

NVidia drivers


Those drivers, which by default are in the repository, are not automatically installed on the new kernel, but give an error. It knocks down all the charm of automatic installation scripts and we have two options - either download the latest installation binaries from the Nvidia website, or use a beautiful method with a patch for drivers.

So, download the patch for the nvidia module:
wget http://lionsimba.lerlan.ru/temp/proc-dir-entry-owner.patch

Copy it to /usr/src/nvidia-180.44/patches/
sudo cp proc-dir-entry-owner.patch /usr/src/nvidia-180.44/patches/

Add the following lines to the /usr/src/nvidia-180.44/dkms.conf file:
PATCH[1]="proc-dir-entry-owner.patch"
PATCH_MATCH[1]="^2.6.30"


Everything, you can use all the delights of dkms and be sure that Nvidia drivers will work on the new kernel.
UPD . It makes sense to look at these comments .

Conclusion


Now, as for impressions. The system has really become subjectively more responsive, the subtle but annoying pauses have been removed during various actions. I confirm the full-screen video on youtube :) - it really does not slow down. From what has been noticed so far - the Composite Ring Switcher for windows has become almost instantaneous - it has previously left a feeling of heaviness and awkwardness. In principle, I will not do tests, benchmarks and measurements - it is more important to me the subjective feelings from working with the machine.

For the time being, I'm definitely staying with this kernel and this scheduler.

UPD . Patch version 2.10 is applied to 2.6.31-rc9 as well (thanks to davnozdu )

Source: https://habr.com/ru/post/68946/


All Articles