Difference between revisions of "Linux-ck"

From ArchWiki
Jump to navigation Jump to search
(Added section "CPUACCT missing in docker" under Troubleshooting for a new incompatibility issue regarding docker and a recent patch on CK that disables the flag CGROUP_CPUACCT in case SCHED_MUQSS is set to "Y")
 
(219 intermediate revisions by 37 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-hans:Linux-ck]]
{{Article summary start}}
+
{{Related articles start}}
{{Article summary text|
+
{{Related|Unofficial user repositories/Repo-ck}}
'''Linux-ck and headers'''
+
{{Related|Modprobed-db}}
*Current version: '''3.6.6-1'''
+
{{Related articles end}}
*BFS CPU scheduler: v0.425
 
*CK Patchset: 3.6-ck1
 
*Release date: 05-Nov-2012}}
 
  
{{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 both in [[AUR]] and in the [[#Use pre-compiled packages|unofficial repo-ck repository]] that allows users to run a kernel and headers setup patched with Con Kolivas' ck patchset[http://ck.kolivas.org/patches/], including a CPU scheduler named MuQSS (''Multiple Queue Skiplist Scheduler'', pronounced ''mux'') which replaces Brain Fuck Scheduler (BFS), his previous work. Many Arch Linux users choose this kernel for its excellent desktop interactivity and responsiveness under any load situation.
{{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 ===
+
CK patchset is designed for desktop/laptop use but not for servers. It provides low latency environment and works well for 16 CPUs or fewer.
Linux-ck roughly follows the release cycle of the official ARCH kernel. The following are requirements for its release:
 
  
*Upstream code
+
=== Release cycle ===
*CK's Patchset
 
*BFQ Patchset
 
*ARCH config/config.x86_64 sets for major version jumps only
 
  
=== Package Defaults ===
+
Linux-ck roughly follows the release cycle of the official Arch kernel but not only. The following are requirements for a new package release:
There are '''three''' modifications to the config files:
 
#The options that the ck patchset enable/disable (duh).
 
#The options that the BFQ patchset need to compile without user interaction.
 
#Disabled NUMA from config files.
 
  
'''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].
+
* CK patchset compatible with the current kernel version
 +
* corresponding Arch kernel must be in existence otherwise it will break other packages i.e. nvidia. See [https://git.archlinux.org/svntogit/packages.git/log/trunk?h=packages/linux git.archlinux.org] for the official {{Pkg|linux}} package
  
==Installation Options==
+
=== Long-Term Support (LTS) CK releases ===
{{Note|As with *any* additional kernel, users will need to manually edit their {{ic|/boot/grub/menu.lst}} (if using [[GRUB]]) or update their {{ic|/boot/grub/grub.cfg}} via "grub-mkconfig -o /boot/grub/grub.cfg" (if using [[GRUB2]]) adding an entry (or entries) for linux-ck.}}
+
 
 +
In addition to the {{AUR|linux-ck}} package, there are LTS kernel releases patched with the above patchsets as well and with the previously mentioned modifications:
 +
 
 +
* {{AUR|linux-lts-ck}} - The current Arch Linux LTS kernel patched with the CK patchset
 +
 
 +
{{Note|This package is maintained by vishwin, thus pre-compiled versions will not be present in the unofficial ck repo.}}
 +
 
 +
== Installation options ==
 +
 
 +
{{Note|As with ''any'' additional kernel, users need to manually update their [[boot loader]]'s configuration file in order to make it aware of the new kernel image.}}
  
 
Users have two options to get these kernel packages.
 
Users have two options to get these kernel packages.
===1. Compile the Package From Source===
 
The [[AUR]] contains entries for both packages mentioned above.  Download and install as you would any other AUR package.
 
{{AUR|linux-ck}} - current kernel in the 3.x.y series.
 
  
Users can customize the linux-ck package via tweaks in the PKGBUILD:
+
=== Compile the package from source ===
  
* Optional nconfig for user specific tweaking.
+
The [[AUR]] contains entries for both packages mentioned above.
* 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.
+
Users can further customize the linux-ck package via tweaks contained 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 configuration''' file.
 
* Optionally set the [http://algo.ing.unimo.it/people/paolo/disk_sched/ BFQ I/O scheduler] as default.
 
* Optionally set the [http://algo.ing.unimo.it/people/paolo/disk_sched/ 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!
+
More details about these options are provided in the PKGBUILD itself.  Be sure to read them carefully if compiling from AUR!
 +
 
 +
{{Note|There are the related PKGBUILDs in AUR for other common kernel modules.  For example {{AUR|nvidia-ck}}, {{AUR|nvidia-340xx-ck}}, and {{AUR|broadcom-wl-ck}} to name a few. Alternatively, use the corresponding [[DKMS]] package, for instance install {{pkg|nvidia-dkms}} as described in [[NVIDIA#Custom kernel]].}}
  
{{Note|There are related PKGBUILDs in the AUR for other common modules unique to linux-ck.  For example {{AUR|nvidia-ck}}, {{AUR|lirc-ck}}, and {{AUR|broadcom-wl-ck}}.}}
+
=== Use pre-compiled packages ===
  
===2. Use Pre-Compiled Packages===
+
If user prefers to spend no time to compile on their own, the unofficial repo maintained by [[User:Graysky|graysky]] is available to the community. For details, see: [[Unofficial user repositories/Repo-ck]].
  
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.
+
== How to enable the BFQ I/O Scheduler ==
  
For details, see: [[Repo-ck]].
+
{{Note|Do not confuse MuQSS (Multiple Queue Skiplist Scheduler) with BFQ (Budget Fair Queueing). MuQSS 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 ==
+
See the [[Improving performance#Input/output schedulers]] section for some background about the different IO schedulers and how to activate ''BFQ''.
=== Globally (for all devices) ===
 
If compiling from the AUR, simply set the BFQ flag to yes in the PKGBUILD prior to building.
 
_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.
+
== More about MuQSS ==
  
=== Selectively (for only specified devices) ===
+
See the [https://lkml.org/lkml/2016/10/29/4 LKML announcement] posted by CK.
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:
 
# echo bfq > /sys/block/sda/queue/scheduler
 
  
To confirm, simply ''cat'' the same file:
+
=== Check if MuQSS is enabled ===
# 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, place the echo line(s) in {{ic|/etc/rc.local}}
+
This start-up message should appear in the kernel ring buffer when MuQSS in enabled:
 +
$ dmesg | grep -i muqss
 +
...
 +
MuQSS CPU scheduler v0.120 by Con Kolivas.
 +
 
 +
=== MuQSS patched kernels and systemd ===
 +
 
 +
It is a common mistake to think that MuQSS does not support ''cgroups''. It does but not all the cgroup features (e.g. CPU limiting will not work).
  
 
== Troubleshooting ==
 
== Troubleshooting ==
=== Running Virtualbox with Linux-ck ===
+
=== Silencing psi: task underflow message ===
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!
+
 
 +
New in MuQSS v0.185 is support for [https://lwn.net/Articles/763629/ PSI] which [http://ck-hack.blogspot.com/2018/12/linux-420-ck1-muqss-version-0185-for.html?showComment=1546576441759#c2919535897335602087 CK is characterizing] as "completely untested and probably broken."
 +
 
 +
In response to this, some users may notice [https://bbs.archlinux.org/viewtopic.php?pid=1824594#p1824594 psi: task underflow!] in dmesg/journalctl output.  With the release of 4.20.0-3-ck1, is compiled in but disabled by default.  Users wanting PSI enabled should boot with the following [Kernel_parameter] on their respective bootloader config: '''psi=1'''
 +
 
 +
=== 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 package on the system.
  
Don't forget to add users to the ''vboxusers '' group:
+
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 offerings 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 build Linux-ck from AUR you '''can not use the repo''' as all packages in the repo are matched groups.}}
 +
 
 +
See the [[Unofficial user repositories/Repo-ck]] to set up it correctly.
 +
 
 +
==== DKMS ====
  
See the [[Repo-ck]] article to setup http://repo-ck.com for pacman to use directly.
+
Install '''virtualbox''' with the '''virtualbox-host-dkms''' package. Then setup DKMS as follows:
 +
# pacman -S virtualbox virtualbox-host-dkms
  
==== Option 2. The virtualbox-ck-modules package (Recommended if Linux-ck is Built by You from the AUR) ====
+
=== CPUACCT missing in docker ===
Install the {{AUR|virtualbox-ck-modules}} package and then install '''virtualbox''' package.
 
  
==== Option 3. Use DKMS (More complicated) ====
+
In newer versions of Linux-ck ([https://aur.archlinux.org/packages/linux-ck#comment-677316 some experienced] with 4.19, 4.20 seems general), a change to the MuQSS was made that disables the {{ic|CONFIG_CGROUP_CPUACCT}} option from the kernel, which makes ''some'' usage of docker ({{ic|run}} or {{ic|build}}) to produce the following error:
Install '''virtualbox''' with the '''virtualbox-host-source''' package.  Then setup dkms as follows:
 
# pacman -S virtualbox virtualbox-host-source
 
# dkms install vboxhost/4.2.0
 
  
{{Note|Make sure to substitute the correct version number of virtualbox in the second command.  At the time of writting, 4.2.2 is current.}}
+
{{hc|$ docker run --rm hello-world|docker: Error response from daemon: unable to find "cpuacct" in controller set: unknown.}}
  
=== Forum Support ===
+
This error does not seems to affect the docker daemon, just containers. This is due a change where the {{ic|CONFIG_CGROUP_CPUACCT}} kernel option is incompatible with {{ic|SCHED_MUQSS}} when the last is set to {{ic|Y}},  as seen in a [https://github.com/ckolivas/linux/commit/1e3f40f5448c4a7a4257f0908f4620b3de679472#diff-df29aead4faac0f63a7af3a16a9ebd1cR1148 recent commit] in ck's repository:
Alway 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==
+
{{bc|@@ -896,6 +913,7 @@ config CGROUP_DEVICE
===BFS 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.
 
#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.
+
config CGROUP_CPUACCT
 +
        bool "Simple CPU accounting controller"
 +
+      depends on !SCHED_MUQSS
 +
        help
 +
          Provides a simple controller for monitoring the
 +
          total CPU consumed by the tasks in a cgroup.
 +
}}
  
===An Example Video About Queuing Theory===
+
You can check more information [https://bbs.archlinux.org/viewtopic.php?pid=1825773#p1825773 in the forums] or in [https://ck-hack.blogspot.com/2018/12/linux-420-ck1-muqss-version-0185-for.html?showComment=1547195122462#c1770603367031092645 ck's blog].
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."
 
  
===Some Performance-Based Metrics: BFS vs. CFS===
+
=== Downgrading ===
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:
+
Users wishing to downgrade to a previous version of Linux-ck, have several options:
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).
+
* 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.
  
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.
+
=== Forum support ===
  
[[http://repo-ck.com/bench/cpu_schedulers_compared.pdf CPU_Schedulers_Compared.pdf]] is available for download.
+
Always feel free to open a thread in the forums for support purpose. Be sure to give the thread a descriptive title to draw attention to the fact that the post relates to the Linux-ck package.
  
==BFS Myths==
+
There is also an [https://bbs.archlinux.org/viewtopic.php?id=111715 official thread] for Linux-ck.
===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 perfectly fine with BFS patched kernels.
 
  
==Further Reading on BFS and CK Patchset==
+
== See also ==
*[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/ Kernel patch repository of Con Kolivas]
 +
* [http://ck-hack.blogspot.it/ Con Kolivas' Blog]
 +
* [http://lkml.org/lkml/2009/9/6/136 Con Kolivas' first BFS announcement on the Linux Kernel Mailing List]
 +
* [[wikipedia:Con_Kolivas|Wikipedia's Con Kolivas page]]
 +
* [[wikipedia:Brain_Fuck_Scheduler|Wikipedia's BFS article]]

Latest revision as of 16:41, 11 January 2019

General package details

Linux-ckAUR is a package available both in AUR and in the unofficial repo-ck repository that allows users to run a kernel and headers setup patched with Con Kolivas' ck patchset[1], including a CPU scheduler named MuQSS (Multiple Queue Skiplist Scheduler, pronounced mux) which replaces Brain Fuck Scheduler (BFS), his previous work. Many Arch Linux users choose this kernel for its excellent desktop interactivity and responsiveness under any load situation.

CK patchset is designed for desktop/laptop use but not for servers. It provides low latency environment and works well for 16 CPUs or fewer.

Release cycle

Linux-ck roughly follows the release cycle of the official Arch kernel but not only. The following are requirements for a new package release:

  • CK patchset compatible with the current kernel version
  • corresponding Arch kernel must be in existence otherwise it will break other packages i.e. nvidia. See git.archlinux.org for the official linux package

Long-Term Support (LTS) CK releases

In addition to the linux-ckAUR package, there are LTS kernel releases patched with the above patchsets as well and with the previously mentioned modifications:

  • linux-lts-ckAUR - The current Arch Linux LTS kernel patched with the CK patchset
Note: This package is maintained by vishwin, thus pre-compiled versions will not be present in the unofficial ck repo.

Installation options

Note: As with any additional kernel, users need to manually update their boot loader's configuration file in order to make it aware of the new kernel image.

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 further customize the linux-ck package via tweaks contained 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 configuration file.
  • Optionally set the BFQ I/O scheduler as default.

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

Note: There are the related PKGBUILDs in AUR for other common kernel modules. For example nvidia-ckAUR, nvidia-340xx-ckAUR, and broadcom-wl-ckAUR to name a few. Alternatively, use the corresponding DKMS package, for instance install nvidia-dkms as described in NVIDIA#Custom kernel.

Use pre-compiled packages

If user prefers to spend no time to compile on their own, the unofficial repo maintained by graysky is available to the community. For details, see: Unofficial user repositories/Repo-ck.

How to enable the BFQ I/O Scheduler

Note: Do not confuse MuQSS (Multiple Queue Skiplist Scheduler) with BFQ (Budget Fair Queueing). MuQSS 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.

See the Improving performance#Input/output schedulers section for some background about the different IO schedulers and how to activate BFQ.

More about MuQSS

See the LKML announcement posted by CK.

Check if MuQSS is enabled

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

$ dmesg | grep -i muqss
...
MuQSS CPU scheduler v0.120 by Con Kolivas.

MuQSS patched kernels and systemd

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

Troubleshooting

Silencing psi: task underflow message

New in MuQSS v0.185 is support for PSI which CK is characterizing as "completely untested and probably broken."

In response to this, some users may notice psi: task underflow! in dmesg/journalctl output. With the release of 4.20.0-3-ck1, is compiled in but disabled by default. Users wanting PSI enabled should boot with the following [Kernel_parameter] on their respective bootloader config: psi=1

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 package 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 build Linux-ck from AUR you can not use the repo as all packages in the repo are matched groups.

See the Unofficial user repositories/Repo-ck to set up it correctly.

DKMS

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

# pacman -S virtualbox virtualbox-host-dkms

CPUACCT missing in docker

In newer versions of Linux-ck (some experienced with 4.19, 4.20 seems general), a change to the MuQSS was made that disables the CONFIG_CGROUP_CPUACCT option from the kernel, which makes some usage of docker (run or build) to produce the following error:

$ docker run --rm hello-world
docker: Error response from daemon: unable to find "cpuacct" in controller set: unknown.

This error does not seems to affect the docker daemon, just containers. This is due a change where the CONFIG_CGROUP_CPUACCT kernel option is incompatible with SCHED_MUQSS when the last is set to Y, as seen in a recent commit in ck's repository:

@@ -896,6 +913,7 @@ config CGROUP_DEVICE

 config CGROUP_CPUACCT
        bool "Simple CPU accounting controller"
+       depends on !SCHED_MUQSS
        help
          Provides a simple controller for monitoring the
          total CPU consumed by the tasks in a cgroup.

You can check more information in the forums or in ck's blog.

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 purpose. Be sure to give the thread a descriptive title to draw attention to the fact that the post relates to the Linux-ck package.

There is also an official thread for Linux-ck.

See also