Difference between revisions of "Linux-ck"

From ArchWiki
Jump to: navigation, search
m (How to enable the BFQ I/O Scheduler: fix section link)
(virtualbox-ck-host-modules is orphaned)
(13 intermediate revisions by 6 users not shown)
Line 4: Line 4:
 
[[zh-hans:Linux-ck]]
 
[[zh-hans:Linux-ck]]
 
{{Related articles start}}
 
{{Related articles start}}
{{Related|Repo-ck}}
+
{{Related|Unofficial user repositories/Repo-ck}}
 
{{Related|Modprobed-db}}
 
{{Related|Modprobed-db}}
 
{{Related articles end}}
 
{{Related articles end}}
Line 10: Line 10:
 
== General package details ==
 
== 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://users.tpg.com.au/ckolivas/kernel/], including 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 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.
  
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.
+
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 ===
 
=== 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:
+
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
 
* 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
+
* 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
  
 
=== Package defaults ===
 
=== Package defaults ===
Line 28: Line 28:
 
# The extra CPU types optionally available to compilation thanks to the [https://github.com/graysky2/kernel_gcc_patch GCC patch].
 
# The extra CPU types optionally available to compilation thanks to the [https://github.com/graysky2/kernel_gcc_patch GCC patch].
  
'''All other options are set to the ARCH defaults outlined in the main kernel's config files.''' Of course users are free to edit them.
+
'''All other options are set to the Arch defaults outlined in the main kernel's config files.''' Of course users are free to edit them.
  
 
The {{AUR|linux-ck}} package contains an option to switch on the '''nconfig''' config editor (see the section [[#Compile the package from source|below]]).
 
The {{AUR|linux-ck}} package contains an option to switch on the '''nconfig''' config editor (see the section [[#Compile the package from source|below]]).
Line 54: Line 54:
 
* Optional '''nconfig''' for user specific tweaking.
 
* Optional '''nconfig''' for user specific tweaking.
 
* Option to compile a minimal set of modules via a make '''localmodconfig'''.
 
* 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.
+
* 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.  Be sure to read them carefully if compiling from 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-304xx-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 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]].}}
  
 
=== Use pre-compiled packages ===
 
=== 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: [[Repo-ck]].
+
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]].
  
 
== How to enable the BFQ I/O Scheduler ==
 
== How to enable the BFQ I/O Scheduler ==
Line 69: Line 69:
 
{{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.}}
 
{{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.}}
  
Budget Fair Queueing is a disk scheduler which allows each process/thread to be assigned a portion of the disk throughput.  Its creator shares the 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 show the latency performance improvement.
+
See the [[Improving performance#Input/output schedulers]] section for some background about the different IO schedulers and how to activate ''BFQ''.
 
 
As of Linux kernel version 4.12, BFQ has been accepted into the mainline kernel. However, it is only available for blk-mq (Multi-Queue Block) so you will have to pass the kernel boot option '''''scsi_mod.use_blk_mq=1''''' and manually select BFQ by issuing the following for each of your devices:
 
 
 
  echo bfq > /sys/block/sda/queue/scheduler
 
 
 
where ''sda'' is the disk in this example.
 
 
 
An alternative method is to create the file ''20-block.rules'' in /etc/udev/rules.d with the below in it:
 
 
 
  ACTION=="add|change", SUBSYSTEM=="block", ATTR{queue/scheduler}="bfq"
 
 
 
This will set BFQ as default during boot for all the disks.
 
 
 
You can also instruct the kernel to use BFQ on a device-by-device basis. For configuration examples see the [[Improving performance#IO schedulers]] section.
 
 
 
{{Note|Setting {{ic|1=elevator=bfq}} as [[kernel parameter]] doesn't work anymore.}}
 
  
 
== More about MuQSS ==
 
== More about MuQSS ==
Line 106: Line 90:
 
=== Running VirtualBox with Linux-ck ===
 
=== 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.
+
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:
 
Do not forget to add users to the ''vboxusers '' group:
Line 115: Line 99:
 
{{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.}}
 
{{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 [[Repo-ck]] section to set up it correctly.
+
See the [[Unofficial user repositories/Repo-ck]] to set up it correctly.
  
==== The virtualbox-ck-host-modules package (recommended if Linux-ck is built from AUR) ====
+
==== DKMS ====
 
 
Install the {{AUR|virtualbox-ck-host-modules}} package and then install the '''virtualbox''' package.
 
 
 
==== Use DKMS (more complicated, recommended for LTS versions) ====
 
  
 
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.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 ===
 
=== Downgrading ===
Line 143: Line 120:
 
* [http://ck.kolivas.org/patches/ Kernel patch repository of Con Kolivas]
 
* [http://ck.kolivas.org/patches/ Kernel patch repository of Con Kolivas]
 
* [http://ck-hack.blogspot.it/ Con Kolivas' Blog]
 
* [http://ck-hack.blogspot.it/ Con Kolivas' Blog]
* [http://lkml.org/lkml/2009/9/6/136 Con Kolivas' desktop-centric kernel patchset]
+
* [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 Kovalis page]]
+
* [[wikipedia:Con_Kolivas|Wikipedia's Con Kolivas page]]
 
* [[wikipedia:Brain_Fuck_Scheduler|Wikipedia's BFS article]]
 
* [[wikipedia:Brain_Fuck_Scheduler|Wikipedia's BFS article]]

Revision as of 19:24, 17 May 2018

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

Package defaults

There are three modifications to the config files:

  1. The options that the CK patchset enable/disable.
  2. The tickrate is set to 100 Hz (CK's recommendation).
  3. The extra CPU types optionally available to compilation thanks to the GCC patch.

All other options are set to the Arch defaults outlined in the main kernel's config files. Of course users are free to edit them.

The linux-ckAUR package contains an option to switch on the nconfig config editor (see the section below).

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

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

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.

See also