Kernel (简体中文)

From ArchWiki
(Redirected from Kernels (简体中文))
Jump to navigation Jump to search


附注: 部分内容未翻译(在 Talk:Kernel (简体中文)# 中讨论)
翻译状态:本文是 Kernel翻译。上次翻译日期:2018-11-02。如果英文版本有所更改,则您可以帮助同步翻译。

来自 Wikipedia:


在Arch Linux中,除了官方内核之外,还有许多各种各样的内核可供选择。这篇文章列出了这些内核和它们的简短介绍。这里还列出了一些可用的内核补丁的介绍。在文章的最后介绍了自行编译内核的方法。


位于 "core" 仓库中,包含了对应的 Linux 内核和内核模块。官方原版内核再加 几个补丁.
更加注重安全的 Linux 内核,采用一系列 加固补丁 以减少内核和用户空间产生漏洞的风险。和 linux 相比,还启用了一些加固选项,比如用户命名空间(同时通过补丁禁用未授权用户的访问)、审计以及 SELinux
长期支持版 (LTS) 位于[core]仓库中,包含了长期支持的 Linux 内核和内核模块。
ZEN Kernel 是一些内核黑客合作的结果,提供了适合日常使用的优秀内核。


Arch Linux 提供了多种内核构建方式。

使用 Arch 构建系统(ABS)(推荐)

推荐使用 Arch 构建系统,这样可以充分利用已有的 linux PKGBUILD 以及包管理系统。PKGBUILD 已经是结构化的,你可以在下载源代码之后配置内核。

参见 编译内核/Arch 构建系统.


另外,也可以不使用 Arch 构建系统 编译内核(传统方式)。这个方法需要手动下载内核源代码包,然后在自己的主目录里以普通用户的权限编译。一旦完成配置之后,有两种编译(安装)方式:传统的安装和适用makepkg/pacman 的安装。


参见 传统方式 .


There are lots of reasons to patch your kernel, the major ones are for performance or support for non-mainline features such as reiser4 file system support. Other reasons might include fun and to see how it is done and what the improvements are.

However, it is important to note that the best way to increase the speed of your system is to first tailor your kernel to your system, especially the architecture and processor type. For this reason using pre-packaged versions of custom kernels with generic architecture settings is not recommended or really worth it. A further benefit is that you can reduce the size of your kernel (and therefore build time) by not including support for things you do not have or use. For example, you might start with the stock kernel config when a new kernel version is released and remove support for things like bluetooth, video4linux, 1000Mbit ethernet, etc.; functionality you know you will not require for your specific machine. Although this page is not about customizing your kernel config, it is recommended as a first step--before moving on to using a patchset once you have grasped the fundamentals involved.

The config files for the Arch kernel packages can be used as a starting point. They are in the Arch package source files, for example [1] linked from linux. The config file of your currently running kernel may also be available in your file system at /proc/config.gz if the CONFIG_IKCONFIG_PROC kernel option is enabled.

If you have not actually patched or customized a kernel before it is not that hard and there are many PKGBUILDs on the forum for individual patchsets. However, you are advised to start from scratch with a bit of research on the benefits of each patchset, rather than just arbitrarily picking one. This way you will learn much more about what you are doing rather than just choosing a kernel at startup and then be left wondering what it actually does.

Warning: Patchsets are developed by a variety of people. Some of these people are actually involved in the production of the linux kernel and others are hobbyists, which may reflect its level of reliability and stability.

Major patchsets

  • Linux-ck — Contains patches by Con Kolivas designed to improve system responsiveness with specific emphasis on the desktop, but suitable to any workload. || linux-ckAUR
  • pf-kernel — Provides you with a handful of awesome features not merged into mainline. It is based on neither existing Linux fork nor patchset, although some unofficial ports may be used if required patches have not been released officially. The most prominent patches of linux-pf are PDS CPU scheduler and UKSM. || Packages:
  • Realtime kernel — Maintained by a small group of core developers, led by Ingo Molnar. This patch allows nearly all of the kernel to be preempted, with the exception of a few very small regions of code ("raw_spinlock critical regions"). This is done by replacing most kernel spinlocks with mutexes that support priority inheritance, as well as moving all interrupt and software interrupts to kernel threads. || linux-rtAUR, linux-rt-ltsAUR

Other patchsets

Some of the listed packages may also be available as binary packages via Unofficial user repositories.

AppArmor || linux-apparmorAUR[断开的链接:package not found]
  • Aufs — The aufs-compatible linux kernel and modules, useful when using docker. || linux-aufs_friendlyAUR[断开的链接:package not found]
  • BLD — Best described as a O(1) CPU picking technique. Which is done by reordering CPU runqueues based on runqueue loads. In other words, it keeps the scheduler aware of the load changes, which helps scheduler to keep runqueues in an order. This technique does not depend on scheduler ticks. The two most simple things in this technique are: load tracking and runqueue ordering; these are relatively simpler operations. Load tracking will be done whenever a load change happens on the system and based on this load change runqueue will be ordered. So, if we have an ordered runqueue from lowest to highest, then picking the less (or even busiest) runqueue is easy. Scheduler can pick the lowest runqueue without calculation and comparison at the time of placing a task in a runqueue. And while trying to distribute load at sched_exec and sched_fork our best choice is to pick the lowest busiest runqueue of the system. And in this way, system remains balanced without doing any load balancing. At the time of try_to_wake_up picking the idlest runqueue is topmost priority but it has been done as per domain basis to utilize CPU cache properly and it's an area where more concentration is requires. || linux-bldAUR[断开的链接:package not found]
  • Git — Linux kernel and modules built using sources from Linus Torvalds' Git repository || linux-gitAUR
  • Libre — The Linux Kernels without "binary blobs". || linux-libreAUR
  • Liquorix — Kernel replacement built using Debian-targeted configuration and the ZEN kernel sources. Designed for desktop, multimedia, and gaming workloads, it is often used as a Debian Linux performance replacement kernel. Damentz, the maintainer of the Liquorix patchset, is a developer for the ZEN patchset as well. || linux-lqxAUR
  • Longterm 4.4 — Long-term support (LTS) Linux 4.4 kernel and modules. || linux-lts44AUR
  • Mainline — The Mainline Linux Kernel and modules. || linux-mainlineAUR
  • MultiPath TCP — The Linux Kernel and modules with Multipath TCP support. || linux-mptcpAUR
  • Reiser4 — Successor filesystem for ReiserFS, developed from scratch by Namesys and Hans Reiser. ||
  • VFIO — The Linux kernel and a few patches written by Alex Williamson (acs override and i915) to enable the ability to do PCI Passthrough with KVM on some machines. || linux-vfioAUR, linux-vfio-ltsAUR