Linux系统安装使用XanMod内核


在这里插入图片描述

XanMod内核现状

一、Xanmod内核简介

  • XanMod是具有自定义设置和新功能的通用Linux内核发行版。旨在提供稳定、响应迅速和流畅的桌面体验。
  • 建议将实时版本用于关键的运行时应用程序,例如Linux游戏电子竞技,流媒体,现场制作和超低延迟爱好者。
  • XanMod的STABLE最新内核,对Debian类衍生系统有更有好的兼容性,当然也包括Deepin(UOS)。

二、XanMod内核主要特性

  • 500Hz 的抢占式全 Tickless 内核,带有调谐的 CPU 内核调度程序。
  • RCU Boost 可提供更好的响应能力和更低的整体系统延迟。
  • 具有高 I/O 吞吐量的多线程运行队列的块层。
  • 缓存、虚拟内存管理器和 CPUFreq 调控器的改进。
  • BBR1 TCP 拥塞控制 + FQ-PIE 数据包调度和 AQM 算法 [5.9]。
  • 用于内核堆栈跟踪 (debuginfo) 实现的 ORC Unwinder。
  • 可用的第三方补丁集:BBR2 TCP Congestion [5.10][作为模块]、ZSTD 内核、initrd 和模块支持 [5.10][5.10-rt][5.10-cacule]、x86_64 FSGSBASE 指令 [5.10][5.10-rt][ 5.10-cacule]、Clear Linux [部分]、CK 的 Hrtimer 补丁集、Wine / Proton Fsync、PCIe ACS Override、Aufs [5.4] 和 GCC graysky。
  • 实时 Linux 内核 (PREEMPT_RT) 构建可用 [5.10-rt][5.4-rt]。
  • 与大多数基于 Debian 和 Ubuntu 的发行版兼容的通用内核包。 基于最新的 GCC 10.2 和 Binutils 2.35。
  • GPLv2 许可证。 可以为任何发行版或目的而构建。

官方文档中的特性很多,其中主要特性为以下几点:

  1. 改善了 CPU 调度能力。
  2. 改善了 I/O 的调度能力。
  3. 增加了一些和性能有关的第三方补丁。
  4. 使用了最新的 GCC 进行编译。
  5. 使用了最新的 MicroCode。

三、安装XanMod内核

1.技术关键
  • 替换XanMod内核的关键在于内核的版本,鉴于STABLE最新内核,对UOS系统的良好容性,因此在选用测试的XanMod内核版本时候,要选择替换STABLE版本,而不是EDGE、LTS、RT版本。
  • 选择合适的内核,不要随便使用最新的内核源码直接编译内核进行替换,因为最新内核有可能存在驱动适配问题导致替换内核后无法正常启动。
2.替换步骤
  • 添加XanMod内核apt源
echo 'deb http://deb.xanmod.org releases main' | sudo tee /etc/apt/sources.list.d/xanmod-kernel.list
  • 添加GPG key
wget -qO - https://dl.xanmod.org/gpg.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/xanmod-kernel.gpg add -
  • 更新apt源并安装XanMod内核
sudo apt update && sudo apt install linux-xanmod
  • 重启机器
sudo reboot
  • 安装CPU微代码(这个可以根据自己需求选择安装)
Intel:
sudo apt install intel-microcode iucode-tool
sudo apt purge amd64-microcode
AMD:
sudo apt install amd64-microcode
sudo apt purge intel-microcode iucode-tool

iucode-tool is a system administration tool to manipulate Intel® X86 and X86-64 processor microcode update collections. It is tailored to help Linux distros do Intel microcode update release management.
iuccode -tool是一个操作Intel®X86和X86-64处理器微码更新集合的系统管理工具。它是专门为帮助Linux发行版做Intel微码更新发布管理而设计的。
iucode-tool cannot change either the microcode itself (the opaque data that is sent unmodified to the system processor to perform the microcode update) or the microcode update container (a documented wrapper with metadata about the microcode update). It lets one create new collections of microcode update containers, by selecting which microcode update containers should be copied unmodified from the microcode data files published by Intel.
iuccode -tool既不能更改微码本身(未修改就发送到系统处理器以执行微码更新的不透明数据),也不能更改微码更新容器(带有关于微码更新的元数据的文档包装器)。它允许创建新的微码更新容器集合,方法是选择应该从Intel发布的微码数据文件中不加修改地复制哪些微码更新容器。
It can also display the contents of microcode update collections, in order to help the Linux distro maintainer keep track of the microcode updates available for each Intel processor, for release management purposes.
它还可以显示微码更新集合的内容,以帮助Linux发行版维护者跟踪每个Intel处理器可用的微码更新,以达到发行版管理的目的。
This release management is necessary to avoid microcode patch level regressions when updating the stable or long-term-service releases of a Linux distro. Intel removes microcode updates for very old end-of-line processors from the public distribution. When a Linux distro blindly propagates such updates to their stable branches, they potentially regress the microcode for some of their users.
当更新一个Linux发行版的稳定或长期服务版本时,这种版本管理是必要的,以避免微码补丁级别的倒退。英特尔从公开发行版中删除了非常旧的行尾处理器的微码更新。当一个Linux发行版盲目地将这些更新传播到它们的稳定分支时,它们可能会为一些用户回归微代码。
iucode-tool was initially written for internal use by the Debian GNU/Linux distro, however, it is maintained with clear separation between upstream code and Debian-specific details and packaging, so it is appropriate for use by any Linux distro.
iucode-tool最初是为Debian GNU/Linux发行版的内部使用而编写的,然而,它的维护在上游代码和Debian特定的细节和打包之间有明确的分离,所以它适用于任何Linux发行版。

  • 设置 FQ-PIE 排队规则(XanMod的内核启用了新的 CAKE 调度算法,如果你在意网络性能的话也可以启用)
echo 'net.core.default_qdisc = fq_pie' | sudo tee /etc/sysctl.d/90-override.conf
3.检查安装是否生效
  • 检查是否成功安装微内核
dmesg | grep -i microcode

微内核安装成功

  • 查看CAKE是否生效
sysctl net.core.default_qdisc
net.core.default_qdisc = cake
  • 查看当前的拥塞控制算法是否为bbr
sysctl net.ipv4.tcp_congestion_control
net.ipv4.tcp_congestion_control = bbr2

三、参考文章

  1. xanmod.org
  2. 安装 XanMod 内核提升核心应用程序效率
  3. 升级内核,推荐使用xanmod内核
  4. 还有一些没有记录上的博客文章
  5. 本文属于参考了众多网上博客文章后实验验证并整理的使用记录型文章,侵删!
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值