Difference between revisions of "Linux-ck"

From ArchWiki
Jump to: navigation, search
(Use pre-compiled packages: broken links removed)
 
(77 intermediate revisions by 23 users not shown)
Line 1: Line 1:
 
[[Category:Kernel]]
 
[[Category:Kernel]]
 +
[[ja:Linux-ck]]
 
[[ru:Linux-ck]]
 
[[ru:Linux-ck]]
 
[[zh-CN:Linux-ck]]
 
[[zh-CN:Linux-ck]]
{{Article summary start}}
+
{{Related articles start}}
{{Article summary text|
+
{{Related|Linux-ck/Changelog}}
'''Linux-ck and headers'''
+
{{Related|Repo-ck}}
*Current version: '''3.11.1-2'''
+
{{Related|Modprobed-db}}
*BFS CPU scheduler: v0.441
+
{{Related articles end}}
*CK Patchset: 3.11-ck1
+
*Release date: 16-Sep-2013}}
+
  
{{Article summary heading|Related}}
+
== General package details ==
{{Article summary wiki|Linux-ck/Changelog}} - Linux-ck Changelog.
+
{{Article summary wiki|Repo-ck}} - Setup and contents of unofficial repo-ck.
+
{{Article summary wiki|Modprobed_db}} - Util to keep track of all probed modules.
+
{{Article summary end}}
+
  
==General Package Details==
+
{{AUR|Linux-ck}} is a package available in the [[AUR]] and in the [[#Use pre-compiled packages|unofficial linux-ck repo]] that allows users to run a kernel/headers setup patched with Con Kolivas' ck1 patchset, including the Brain Fuck Scheduler (BFS).  Many Archers elect to use this package for the BFS' excellent desktop interactivity and responsiveness under any load situation.  Additionally, the bfs imparts performance gains beyond interactivity.  For example, see: [http://repo-ck.com/bench/cpu_schedulers_compared.pdf CPU_Schedulers_Compared.pdf].
{{AUR|Linux-ck}} is a package available in the [[AUR]] and in the [[#2._Use_Pre-Compiled_Packages|unofficial linux-ck repo]] that allows users to run a kernel/headers setup patched with Con Kolivas' ck1 patchset, including the Brain Fuck Scheduler (BFS).  Many Archers elect to use this package for the BFS' excellent desktop interactivity and responsiveness under any load situation.  Additionally, the bfs imparts performance gains beyond interactivity.  For example, see: [[http://repo-ck.com/bench/cpu_schedulers_compared.pdf CPU_Schedulers_Compared.pdf]].
+
 
 +
=== Release cycle ===
  
=== Release Cycle ===
 
 
Linux-ck roughly follows the release cycle of the official ARCH kernel.  The following are requirements for its release:
 
Linux-ck roughly follows the release cycle of the official ARCH kernel.  The following are requirements for its release:
  
*Upstream code
+
* Corresponding ARCH kernel base must be in [core] or else the corresponding modules such as nvidia, nvidia-304xx, nvidia-340xx, and vbox will not be available to users and will cause version conflicts.
*CK's Patchset
+
* CK's patchset.
*BFQ Patchset
+
* BFQ patchset (until it gets mainlined).
*ARCH config/config.x86_64 sets for major version jumps only
+
 
 +
=== Package defaults ===
  
=== Package Defaults ===
 
 
There are '''three''' modifications to the config files:
 
There are '''three''' modifications to the config files:
#The options that the ck patchset enable/disable.
+
# The options that the ck patchset enable/disable.
#The options that the BFQ patchset need to compile without user interaction.
+
# The options that the BFQ patchset need to compile without user interaction.
#Apply [https://github.com/graysky2/kernel_gcc_patch GCC patch] that enables additional CPU optimizations at compile time (these options are not part of the standard linux-ck package and are only available when the user compiles custom options).
+
# Apply [https://github.com/graysky2/kernel_gcc_patch GCC patch] that enables additional CPU optimizations at compile time (these options are not part of the standard linux-ck package and are only available when the user compiles custom options).
  
 
'''All other options are set to the ARCH defaults outlined in the main kernel's config files.'''  Users are of course free to modify them!  The linux-ck package contains an option to switch on the '''nconfig''' config editor (see section below).  For some suggestions, see CK's [http://ck.kolivas.org/patches/bfs/bfs-configuration-faq.txt BFS configuration FAQ].
 
'''All other options are set to the ARCH defaults outlined in the main kernel's config files.'''  Users are of course free to modify them!  The linux-ck package contains an option to switch on the '''nconfig''' config editor (see section below).  For some suggestions, see CK's [http://ck.kolivas.org/patches/bfs/bfs-configuration-faq.txt BFS configuration FAQ].
  
==Installation Options==
+
=== Long-Term Support (LTS) CK releases ===
{{Note|As with *any* additional kernel, users will need to manually edit their boot loader's config file to make it aware of the new kernel images. For example, users of [[GRUB]] should execute "grub-mkconfig -o /boot/grub/grub.cfg".  Syslinux, GRUB-legacy, etc. will need to be modified as well.}}
+
 
 +
In addition to the linux-ck package, there are the following LTS kernel releases patched with the above patchsets, with the previously mentioned modifications to the config files:
 +
 
 +
* {{AUR|linux-lts-ck}} - The current ArchLinux LTS kernel patched with the CK patchset
 +
* {{AUR|linux-lts310-ck}} - The 3.10 LTS kernel patched with the CK patchset
 +
* {{AUR|linux-lts312-ck}} - The 3.12 LTS kernel patched with the CK patchset
 +
 
 +
'''These three packages are maintained by clfarron4. Pre-packaged versions will not be found in the unofficial ck repo.'''
 +
 
 +
== Installation options ==
 +
 
 +
{{Note|As with ''any'' additional kernel, users will need to manually update their [[boot loader]]'s config file to make it aware of the new kernel images. For GRUB, see [[GRUB#Generate the main configuration file]]. For other boot loaders it may be necessary to add a custom entry.}}
  
 
Users have two options to get these kernel packages.
 
Users have two options to get these kernel packages.
===1. Compile the Package From Source===
+
 
 +
=== Compile the package from source ===
 +
 
 
The [[AUR]] contains entries for both packages mentioned above.
 
The [[AUR]] contains entries for both packages mentioned above.
  
Line 51: Line 59:
 
More details about these options are provided in the PKGBUILD itself via line comments.  Be sure to read them if compiling from the AUR!
 
More details about these options are provided in the PKGBUILD itself via line comments.  Be sure to read them if compiling from the AUR!
  
{{Note|There are related PKGBUILDs in the AUR for other common modules unique to linux-ck.  For example {{AUR|nvidia-ck}}, {{AUR|nvidia-304xx-ck}},{{AUR|lirc-ck}}, and {{AUR|broadcom-wl-ck}}.}}
+
{{Note|There are related PKGBUILDs in the AUR for other common modules unique to linux-ck.  For example {{AUR|nvidia-ck}}, {{AUR|nvidia-304xx-ck}}, {{AUR|nvidia-340xx-ck}}, and {{AUR|broadcom-wl-ck}} to name a few.}}
  
===2. Use Pre-Compiled Packages===
+
=== Use pre-compiled packages ===
  
If users would rather not spend the time to compile on their own, an unofficial repo maintained by [[User:Graysky|graysky]] is available to the community.
+
If users would rather not spend the time to compile on their own, an unofficial repo maintained by [[User:Graysky|graysky]] is available to the community. For details, see: [[Repo-ck]].
  
For details, see: [[Repo-ck]].
+
== How to enable the BFQ I/O Scheduler ==
 +
{{Note|Do not confuse BFS (Brain Fuck Scheduler) with BFQ (Budget Fair Queueing). The BFS is a CPU scheduler and is enabled by default whereas BFQ is an I/O scheduler and must explicitly be enabled in order to use it.}}
  
== How to Enable the BFQ I/O Scheduler ==
+
Budget Fair Queueing is a disk scheduler which allows each process/thread to be assigned a portion of the disk throughput.  Its creator has released results of many benchmarks ([http://algo.ing.unimo.it/people/paolo/disk_sched/results.php results] and [http://www.youtube.com/watch?v=KhZl9LjCKuU video]) which shows some pretty amazing latency performance.
  
Budget Fair Queueing is a disk scheduler which allows each process/thread to be assigned a portion of the disk throughput.
+
Since linux-ck-3.0.4-2, the BFQ patchset is applied to the package by default, but the scheduler must be enabled manually.  Users have several options to do so.
  
=== Globally (for all devices) ===
+
=== Enable BFQ for all devices ===
If compiling from the AUR, simply set the BFQ flag to yes in the PKGBUILD prior to building.
+
 
 +
If compiling from the AUR, simply set the BFQ flag to "y" in the PKGBUILD prior to building
 
  _BFQ_enable_="y"
 
  _BFQ_enable_="y"
  
If using the repo packages, append "elevator=bfq" to the kernel boot line in {{ic|/boot/grub/menu.lst}} if using grub or in {{ic|/etc/default/grub}} under the '''GRUB_CMDLINE_LINUX_DEFAULT="quiet"''' line followed by rebuilding {{ic|/boot/grub/grub.cfg}} via the standard "grub-mkconfig -o /boot/grub/grub.cfg" command.
+
Users of [[repo-ck]] or those who have not modified the PKGBUILD prior to building may appened {{ic|1=elevator=bfq}} to the [[kernel parameters]].
  
=== Selectively (for only specified devices) ===
+
=== Enable BFQ for only specified devices ===
An alternative method is to direct the kernel to use it on a device-by-device basis. For example, to enable it for {{ic|/dev/sda}} simply:
+
 
 +
An alternative method is to direct the kernel to use BFQ on a device-by-device basis. For example, to enable it for {{ic|/dev/sda}} simply:
 
  # echo bfq > /sys/block/sda/queue/scheduler
 
  # echo bfq > /sys/block/sda/queue/scheduler
  
To confirm, simply ''cat'' the same file:
+
To confirm:
 
  # cat /sys/block/sda/queue/scheduler
 
  # cat /sys/block/sda/queue/scheduler
 
  noop deadline cfq [bfq]  
 
  noop deadline cfq [bfq]  
  
Note that doing it this way will not survive a reboot.  To make the change automatically at the next system boot, place lines in {{ic|/etc/tmpfiles.d/IO_scheduler.conf}}:
+
Note that doing it this way will not survive a reboot.  To make the change automatically at the next system boot, create the following tmpfile where sdX is the desired device:
 
+
{{hc|/etc/tmpfiles.d/set_IO_scheduler.conf|
w /sys/block/sda/queue/scheduler - - - - bfq
+
w /sys/block/sdX/queue/scheduler - - - - bfq}}
  
 
== Troubleshooting ==
 
== Troubleshooting ==
=== Running Virtualbox with Linux-ck ===
 
Virtualbox works just fine with custom kernels such as Linux-ck ''without'' the need to keep any of the official ARCH kernel-headers packages on the system!
 
  
Don't forget to add users to the ''vboxusers '' group:
+
=== Running VirtualBox with Linux-ck ===
 +
 
 +
VirtualBox works just fine with custom kernels such as Linux-ck ''without'' the need to keep any of the official ARCH kernel-headers packages on the system!
 +
 
 +
Do not forget to add users to the ''vboxusers '' group:
 
  # gpasswd -a USERNAME vboxusers
 
  # gpasswd -a USERNAME vboxusers
  
==== Option 1. Use the Unofficial Repo (Recommended) ====
+
==== Use the unofficial repo (recommended if linux-ck is installed from Repo-ck) ====
{{Note|As of 17-Oct-2012, Repo-ck users can enjoy these modules as precompiled packages in the repo itself.  If you built your linux-ck from the AUR you CANNOT USE THE REPO as all packages in the repo are matched groups.}}
+
 
 +
{{Note|As of 17-Oct-2012, Repo-ck users can enjoy these modules as pre-compiled packages in the repo itself.  If you built your linux-ck from the AUR you '''cannot use the repo''' as all packages in the repo are matched groups.}}
 +
 
 +
See the [[Repo-ck]] article to set up http://repo-ck.com for pacman to use directly.
 +
 
 +
==== The virtualbox-ck-host-modules package (recommended if linux-ck is built by you from the AUR) ====
  
See the [[Repo-ck]] article to setup http://repo-ck.com for pacman to use directly.
+
Install the {{AUR|virtualbox-ck-host-modules}} package and then install '''virtualbox''' package.
  
==== Option 2. The virtualbox-ck-modules package (Recommended if Linux-ck is Built by You from the AUR) ====
+
==== Use DKMS (more complicated, recommended with LTS releases) ====
Install the {{AUR|virtualbox-ck-modules}} package and then install '''virtualbox''' package.
+
  
==== Option 3. Use DKMS (More complicated) ====
 
 
Install '''virtualbox''' with the '''virtualbox-host-dkms''' package.  Then setup dkms as follows:
 
Install '''virtualbox''' with the '''virtualbox-host-dkms''' package.  Then setup dkms as follows:
 
  # pacman -S virtualbox virtualbox-host-dkms
 
  # pacman -S virtualbox virtualbox-host-dkms
  # dkms install vboxhost/4.2.6
+
  # dkms install vboxhost/4.3.12
  
{{Note|Make sure to substitute the correct version number of virtualbox in the second command.  At the time of writting, 4.2.6 is current.}}
+
{{Note|Make sure to substitute the correct version number of virtualbox in the second command.  At the time of writing, 4.3.12 is current.}}
  
 
=== Downgrading ===
 
=== Downgrading ===
 +
 
Users wishing to downgrade to a previous version of linux-ck, have several options:
 
Users wishing to downgrade to a previous version of linux-ck, have several options:
*Source archives are [http://repo-ck.com/bench.htm available] dating back to linux-ck-3.3.7-1.  
+
* Source archives are [http://repo-ck.com/bench.htm available] dating back to linux-ck-3.3.7-1.  
*[http://pkgbuild.com/git/aur-mirror.git/log/linux-ck AUR.git] holds AUR git commits for linux-ck dating back to linux-ck-2.6.39.3-1.
+
* [http://pkgbuild.com/git/aur-mirror.git/log/linux-ck AUR.git] holds AUR git commits for linux-ck dating back to linux-ck-2.6.39.3-1.
 +
 
 +
=== Forum support ===
  
=== Forum Support ===
 
 
Always feel free to open a thread in the forums for support.  Be sure to give the thread a descriptive title to draw attention to the fact that the post relates to the Linux- ck package.
 
Always feel free to open a thread in the forums for support.  Be sure to give the thread a descriptive title to draw attention to the fact that the post relates to the Linux- ck package.
  
==A Little About the BFS==
+
== A little about the BFS ==
  
 
The Brain Fuck Scheduler is a desktop orientated cpu process scheduler with extremely low latencies for excellent interactivity within normal load levels.
 
The Brain Fuck Scheduler is a desktop orientated cpu process scheduler with extremely low latencies for excellent interactivity within normal load levels.
  
===BFS Design Goals===
+
=== BFS design goals ===
 +
 
 
The BFS has two major design goals:
 
The BFS has two major design goals:
 
#Achieve excellent desktop interactivity and responsiveness without heuristics and tuning knobs that are difficult to understand, impossible to model and predict the effect of, and when tuned to one workload cause massive detriment to another.
 
#Achieve excellent desktop interactivity and responsiveness without heuristics and tuning knobs that are difficult to understand, impossible to model and predict the effect of, and when tuned to one workload cause massive detriment to another.
 
#Completely do away with the complex designs of the past for the cpu process scheduler and instead implement one that is very simple in basic design.
 
#Completely do away with the complex designs of the past for the cpu process scheduler and instead implement one that is very simple in basic design.
  
For additional information, see the [[linux-ck#Further_Reading_on_BFS_and_CK_Patchset]] section of this article.
+
For additional information, see the [[#Further Reading on BFS and CK Patchset]] section of this article.
 +
 
 +
=== An example video about queuing theory ===
  
===An Example Video About Queuing Theory===
 
 
See [http://www.youtube.com/watch?v=F5Ri_HhziI0 this video] about queuing theory for an interesting parallel with
 
See [http://www.youtube.com/watch?v=F5Ri_HhziI0 this video] about queuing theory for an interesting parallel with
supermarket checkouts.  Quote from CK, "the relevance of that video is that BFS uses a single queue, whereas the mainline Linux kernel uses a multiple queue design. The people are tasks, and the checkouts are CPUs. Of course there's a lot more to a CPU scheduler than just the queue design, but I thought this video was very relevant."
+
supermarket checkouts.  Quote from CK, "the relevance of that video is that BFS uses a single queue, whereas the mainline Linux kernel uses a multiple queue design. The people are tasks, and the checkouts are CPUs. Of course there is a lot more to a CPU scheduler than just the queue design, but I thought this video was very relevant."
 +
 
 +
=== Some performance-based metrics: BFS vs. CFS ===
  
===Some Performance-Based Metrics: BFS vs. CFS===
 
 
A major benefit of using the BFS is increased responsiveness.  The benefits however, are not limited to desktop feel.  [[User:Graysky|Graysky]] put together some non-responsiveness based benchmarks to compare it to the CFS contained in the "stock" linux kernel.  Seven different machines were used to see if differences exist and, to what degree they scale using performance based metrics.  Again, these end-points were never factors in the primary design goals of the bfs.  Results were encouraging.  
 
A major benefit of using the BFS is increased responsiveness.  The benefits however, are not limited to desktop feel.  [[User:Graysky|Graysky]] put together some non-responsiveness based benchmarks to compare it to the CFS contained in the "stock" linux kernel.  Seven different machines were used to see if differences exist and, to what degree they scale using performance based metrics.  Again, these end-points were never factors in the primary design goals of the bfs.  Results were encouraging.  
  
 
For those not wanting to see the full report, here is the conclusion:
 
For those not wanting to see the full report, here is the conclusion:
Kernels patched with the ck1 patch set including the bfs outperformed the vanilla kernel using the cfs at nearly all the performance-based benchmarks tested. Further study with a larger test set could be conducted, but based on the small test set of 7 PCs evaluated, these increases in process queuing, efficiency/speed are, on the whole, independent of CPU type (mono, dual, quad, hyperthreaded, etc.), CPU architecture (32-bit and 64-bit), 64 bit) and of CPU multiplicity (mono or dual socket).
+
Kernels patched with the ck1 patch set including the bfs outperformed the vanilla kernel using the cfs at nearly all the performance-based benchmarks tested. Further study with a larger test set could be conducted, but based on the small test set of 7 PCs evaluated, these increases in process queuing, efficiency/speed are, on the whole, independent of CPU type (mono, dual, quad, hyperthreaded, etc.), CPU architecture (32-bit and 64-bit) and of CPU multiplicity (mono or dual socket).
  
 
Moreover, several "modern" CPUs (Intel C2D and Ci7) that represent common workstations and laptops, consistently outperformed the cfs in the vanilla kernel at all benchmarks.  Efficiency and speed gains were small to moderate.
 
Moreover, several "modern" CPUs (Intel C2D and Ci7) that represent common workstations and laptops, consistently outperformed the cfs in the vanilla kernel at all benchmarks.  Efficiency and speed gains were small to moderate.
  
[[http://repo-ck.com/bench/cpu_schedulers_compared.pdf CPU_Schedulers_Compared.pdf]] is available for download.
+
[http://repo-ck.com/bench/cpu_schedulers_compared.pdf CPU_Schedulers_Compared.pdf] is available for download.
 +
 
 +
=== Check if enabled ===
  
=== Check if Enabled ===
 
 
This start-up message should appear in the kernel ring buffer when BFS in enabled:
 
This start-up message should appear in the kernel ring buffer when BFS in enabled:
 
  # dmesg | grep scheduler
 
  # dmesg | grep scheduler
Line 142: Line 164:
 
  [    0.380500] BFS CPU scheduler v0.420 by Con Kolivas.
 
  [    0.380500] BFS CPU scheduler v0.420 by Con Kolivas.
  
==BFS Myths==
+
== BFS myths==
===BFS patched kernels CAN in fact use systemd===
+
 
It is a common mistake to think that bfs does not support cgroups. It does support cgroups, just not all the cgroup features. Systemd works with BFS patched kernels, though systemd user sessions are broken for now, as some of those missing features are required to start {{ic|systemd --user}}.
+
=== BFS patched kernels CAN in fact use systemd ===
 +
 
 +
It is a common mistake to think that BFS does not support cgroups. It does support cgroups, just not all the cgroup features (e. g. CPU limiting will not work).
  
==Further Reading on BFS and CK Patchset==
+
== Further Reading on BFS and CK Patchset ==
*[http://ck.kolivas.org/patches/bfs/bfs-faq.txt Con Kolivas' White Paper on the BFS]
+
*[http://en.wikipedia.org/wiki/Brain_Fuck_Scheduler Wikipedia's BFS Article]
+
*[http://ck-hack.blogspot.com/ Con Kolivas' Blog]
+
  
==[[Linux-ck/Changelog|Linux-ck Package Changelog]]==
+
* [http://ck.kolivas.org/patches/bfs/bfs-faq.txt Con Kolivas' White Paper on the BFS]
 +
* [[wikipedia:Brain_Fuck_Scheduler|Wikipedia's BFS Article]]
 +
* [http://ck-hack.blogspot.com/ Con Kolivas' Blog]

Latest revision as of 14:08, 14 August 2016

General package details

Linux-ckAUR is a package available in the AUR and in the unofficial linux-ck repo that allows users to run a kernel/headers setup patched with Con Kolivas' ck1 patchset, including the Brain Fuck Scheduler (BFS). Many Archers elect to use this package for the BFS' excellent desktop interactivity and responsiveness under any load situation. Additionally, the bfs imparts performance gains beyond interactivity. For example, see: CPU_Schedulers_Compared.pdf.

Release cycle

Linux-ck roughly follows the release cycle of the official ARCH kernel. The following are requirements for its release:

  • Corresponding ARCH kernel base must be in [core] or else the corresponding modules such as nvidia, nvidia-304xx, nvidia-340xx, and vbox will not be available to users and will cause version conflicts.
  • CK's patchset.
  • BFQ patchset (until it gets mainlined).

Package defaults

There are three modifications to the config files:

  1. The options that the ck patchset enable/disable.
  2. The options that the BFQ patchset need to compile without user interaction.
  3. Apply GCC patch that enables additional CPU optimizations at compile time (these options are not part of the standard linux-ck package and are only available when the user compiles custom options).

All other options are set to the ARCH defaults outlined in the main kernel's config files. Users are of course free to modify them! The linux-ck package contains an option to switch on the nconfig config editor (see section below). For some suggestions, see CK's BFS configuration FAQ.

Long-Term Support (LTS) CK releases

In addition to the linux-ck package, there are the following LTS kernel releases patched with the above patchsets, with the previously mentioned modifications to the config files:

  • linux-lts-ckAUR - The current ArchLinux LTS kernel patched with the CK patchset
  • linux-lts310-ckAUR - The 3.10 LTS kernel patched with the CK patchset
  • linux-lts312-ckAUR - The 3.12 LTS kernel patched with the CK patchset

These three packages are maintained by clfarron4. Pre-packaged versions will not be found in the unofficial ck repo.

Installation options

Note: As with any additional kernel, users will need to manually update their boot loader's config file to make it aware of the new kernel images. For GRUB, see GRUB#Generate the main configuration file. For other boot loaders it may be necessary to add a custom entry.

Users have two options to get these kernel packages.

Compile the package from source

The AUR contains entries for both packages mentioned above.

Users can customize the linux-ck package via tweaks in the PKGBUILD:

  • Optional nconfig for user specific tweaking.
  • Option to compile a minimal set of modules via a make localmodconfig.
  • Option to bypass the standard ARCH config options and simply use the current kernel's .config file.
  • Optionally set the BFQ I/O scheduler as default.

More details about these options are provided in the PKGBUILD itself via line comments. Be sure to read them if compiling from the AUR!

Note: There are related PKGBUILDs in the AUR for other common modules unique to linux-ck. For example nvidia-ckAUR, nvidia-304xx-ckAUR, nvidia-340xx-ckAUR, and broadcom-wl-ckAUR to name a few.

Use pre-compiled packages

If users would rather not spend the time to compile on their own, an unofficial repo maintained by graysky is available to the community. For details, see: Repo-ck.

How to enable the BFQ I/O Scheduler

Note: Do not confuse BFS (Brain Fuck Scheduler) with BFQ (Budget Fair Queueing). The BFS is a CPU scheduler and is enabled by default whereas BFQ is an I/O scheduler and must explicitly be enabled in order to use it.

Budget Fair Queueing is a disk scheduler which allows each process/thread to be assigned a portion of the disk throughput. Its creator has released results of many benchmarks (results and video) which shows some pretty amazing latency performance.

Since linux-ck-3.0.4-2, the BFQ patchset is applied to the package by default, but the scheduler must be enabled manually. Users have several options to do so.

Enable BFQ for all devices

If compiling from the AUR, simply set the BFQ flag to "y" in the PKGBUILD prior to building

_BFQ_enable_="y"

Users of repo-ck or those who have not modified the PKGBUILD prior to building may appened elevator=bfq to the kernel parameters.

Enable BFQ for only specified devices

An alternative method is to direct the kernel to use BFQ on a device-by-device basis. For example, to enable it for /dev/sda simply:

# echo bfq > /sys/block/sda/queue/scheduler

To confirm:

# cat /sys/block/sda/queue/scheduler
noop deadline cfq [bfq] 

Note that doing it this way will not survive a reboot. To make the change automatically at the next system boot, create the following tmpfile where sdX is the desired device:

/etc/tmpfiles.d/set_IO_scheduler.conf
w /sys/block/sdX/queue/scheduler - - - - bfq

Troubleshooting

Running VirtualBox with Linux-ck

VirtualBox works just fine with custom kernels such as Linux-ck without the need to keep any of the official ARCH kernel-headers packages on the system!

Do not forget to add users to the vboxusers group:

# gpasswd -a USERNAME vboxusers

Use the unofficial repo (recommended if linux-ck is installed from Repo-ck)

Note: As of 17-Oct-2012, Repo-ck users can enjoy these modules as pre-compiled packages in the repo itself. If you built your linux-ck from the AUR you cannot use the repo as all packages in the repo are matched groups.

See the Repo-ck article to set up http://repo-ck.com for pacman to use directly.

The virtualbox-ck-host-modules package (recommended if linux-ck is built by you from the AUR)

Install the virtualbox-ck-host-modulesAUR package and then install virtualbox package.

Use DKMS (more complicated, recommended with LTS releases)

Install virtualbox with the virtualbox-host-dkms package. Then setup dkms as follows:

# pacman -S virtualbox virtualbox-host-dkms
# dkms install vboxhost/4.3.12
Note: Make sure to substitute the correct version number of virtualbox in the second command. At the time of writing, 4.3.12 is current.

Downgrading

Users wishing to downgrade to a previous version of linux-ck, have several options:

  • Source archives are available dating back to linux-ck-3.3.7-1.
  • AUR.git holds AUR git commits for linux-ck dating back to linux-ck-2.6.39.3-1.

Forum support

Always feel free to open a thread in the forums for support. Be sure to give the thread a descriptive title to draw attention to the fact that the post relates to the Linux- ck package.

A little about the BFS

The Brain Fuck Scheduler is a desktop orientated cpu process scheduler with extremely low latencies for excellent interactivity within normal load levels.

BFS design goals

The BFS has two major design goals:

  1. Achieve excellent desktop interactivity and responsiveness without heuristics and tuning knobs that are difficult to understand, impossible to model and predict the effect of, and when tuned to one workload cause massive detriment to another.
  2. Completely do away with the complex designs of the past for the cpu process scheduler and instead implement one that is very simple in basic design.

For additional information, see the #Further Reading on BFS and CK Patchset section of this article.

An example video about queuing theory

See this video about queuing theory for an interesting parallel with supermarket checkouts. Quote from CK, "the relevance of that video is that BFS uses a single queue, whereas the mainline Linux kernel uses a multiple queue design. The people are tasks, and the checkouts are CPUs. Of course there is a lot more to a CPU scheduler than just the queue design, but I thought this video was very relevant."

Some performance-based metrics: BFS vs. CFS

A major benefit of using the BFS is increased responsiveness. The benefits however, are not limited to desktop feel. Graysky put together some non-responsiveness based benchmarks to compare it to the CFS contained in the "stock" linux kernel. Seven different machines were used to see if differences exist and, to what degree they scale using performance based metrics. Again, these end-points were never factors in the primary design goals of the bfs. Results were encouraging.

For those not wanting to see the full report, here is the conclusion: Kernels patched with the ck1 patch set including the bfs outperformed the vanilla kernel using the cfs at nearly all the performance-based benchmarks tested. Further study with a larger test set could be conducted, but based on the small test set of 7 PCs evaluated, these increases in process queuing, efficiency/speed are, on the whole, independent of CPU type (mono, dual, quad, hyperthreaded, etc.), CPU architecture (32-bit and 64-bit) and of CPU multiplicity (mono or dual socket).

Moreover, several "modern" CPUs (Intel C2D and Ci7) that represent common workstations and laptops, consistently outperformed the cfs in the vanilla kernel at all benchmarks. Efficiency and speed gains were small to moderate.

CPU_Schedulers_Compared.pdf is available for download.

Check if enabled

This start-up message should appear in the kernel ring buffer when BFS in enabled:

# dmesg | grep scheduler
...
[    0.380500] BFS CPU scheduler v0.420 by Con Kolivas.

BFS myths

BFS patched kernels CAN in fact use systemd

It is a common mistake to think that BFS does not support cgroups. It does support cgroups, just not all the cgroup features (e. g. CPU limiting will not work).

Further Reading on BFS and CK Patchset