TKT
A fork of the Frogging-Family/linux-tkg script optimized for a little more performance.
Install / Use
/learn @ETJAKEOC/TKTREADME
DO NOT IGNORE! YOU MUST READ THIS BEFORE YOU EVEN CLONE THE REPO IN ORDER TO USE IT!
Most questions you can ask will be answered in this file.
TꓘT (The Kernel Toolkit) - A linux-tkg fork
Tested distro's so far;
| Logo | Distro | Status | |------|-------------|--------------------------------------------| | <img src="https://upload.wikimedia.org/wikipedia/commons/f/f9/Archlinux-logo-standard-version.svg" width="128"/> | Arch Linux | ✅ Working | | <img src="https://upload.wikimedia.org/wikipedia/commons/4/4a/Debian-OpenLogo.svg" width="64"/> | Debian | ✅ Working | | <img src="https://upload.wikimedia.org/wikipedia/commons/3/3f/Fedora_logo.svg" width="64"/> | Fedora | ✅ Working | | <img src="https://upload.wikimedia.org/wikipedia/commons/4/48/Gentoo_Linux_logo_matte.svg" width="64"/> | Gentoo | ✅ Working | | <img src="https://upload.wikimedia.org/wikipedia/commons/3/3f/Linux_Mint_logo_without_wordmark.svg" width="64"/> | Linux Mint | ✅ Working (Use Ubuntu kernel) | | <img src="https://upload.wikimedia.org/wikipedia/commons/d/d0/OpenSUSE_Logo.svg" width="64"/> | OpenSUSE | ✅ Working (Only if SELinux is disabled) | | <img src="https://www.pngkit.com/png/full/659-6591257_2000px-slackware-logo-svg1.png" width="64"/> | Slackware | ✅ Working | | <img src="https://upload.wikimedia.org/wikipedia/commons/7/76/Ubuntu-logo-2022.svg" width="128"/> | Ubuntu | ✅ Working | | <img src="https://upload.wikimedia.org/wikipedia/commons/0/02/Void_Linux_logo.svg" width="64"/> | Void Linux | ✅ Working |
WE HAVE PREBUILT KERNELS FOR TESTING!!!
Please check the release tab for the specific kernel of your choosing.
All kernel builds tested in a VM install.
- If you like the work I do here, and want to donate to me/the project, checkout the DONATIONS.MD file.
- Please checkout the CONTRIBUTIONS_GUIDELINE.MD file for information about collaboration or how to help the project in general.
- Please read the COMPILATION_GUIDELINE.MD file for information about how to run the script and compile your own kernel.
This repository provides scripts to automatically download, patch and compile the Linux Kernel from the official Linux git repository, with a selection of patches aiming for better desktop/gaming experience. The provided patches can be enabled/disabled by editing the customization.cfg file and/or by following the interactive install script. You can use an external config file (default is $HOME/.config/TKT.cfg, tweakable with the _EXT_CONFIG_PATH variable in customization.cfg). You can also use your own patches (more information in customization.cfg file).
Important information
-
Non-pacman distros support can be considered experimental. You're invited to report issues you might encounter with it.
-
If your distro isn't using systemd, please set _configfile="running-kernel" in customization.cfg or you might end up with a non-bootable kernel
-
Keep in mind building recent linux kernels with GCC will require ~20-25GB of disk space. Using llvm/clang, LTO, ccache and/or enabling more drivers in the defconfig will push that requirement higher, so make sure you have enough free space on the volume you're using to build.
-
In
intel_pstatedriver, frequency scaling aggressiveness has been changed with kernel 5.5 which results in stutters and poor performance in low/medium load scenarios (for higher power savings). As a workaround for our gaming needs, we are setting it to passive mode to make use of theacpi_cpufreqgovernor passthrough, keeping full support for turbo frequencies. It's combined with our aggressive ondemand governor by default for good performance on most CPUs while keeping frequency scaling for power savings. In a typical low/medium load scenario (Core i7 9700k, playing Mario Galaxy on Dolphin emulator) intel_pstate in performance mode gives a stuttery 45-50 fps experience, while passive mode + aggressive ondemand offers a locked 60 fps. -
Nvidia's proprietary drivers might need to be patched if they don't support your chosen kernel OOTB: Frogging-Family nvidia-all can do that automatically for you.
-
Note regarding kernels older than 5.9 on Arch Linux: since the switch to
zstdcompressedinitramfsby default, you will face aninvalid magic at start of compresserror by default. You can workaround the issue by editing/etc/mkinitcpio.confto uncomment theCOMPRESSION="lz4"(for example, since that's the best option after zstd) line and regeneratinginitramfsfor all kernels withsudo mkinitpcio -P
Customization options
Alternative CPU schedulers
CFS is the only CPU scheduler available in the "vanilla" kernel sources ≤ 6.5. EEVDF is the only CPU scheduler available in the "vanilla" kernel sources ≥ 6.6.
Its current implementation doesn't allow for injecting additional schedulers at kernel level, and requires replacing it. Only one scheduler can be patched in at a time.
However, using Sched-ext, it's possible to inject CPU schedulers at runtime. We offer support for it on ≥ 6.8 by default.
Arch users get scx schedulers from the scx-scheds package or on the AUR thanks to @sirlucjan (for persistence, set scheduler in "/etc/default/scx" and enable the scx service).
Alternative schedulers are available to you in TKT:
- MuQSS by Con Kolivas : blog, code repository
- CacULE by Hamad Marri - CFS based : code repository
- Task Type (TT) by Hamad Marri - CFS based : code repository
- BORE (Burst-Oriented Response Enhancer) by Masahito Suzuki - CFS/EEVDF based : code repository
These alternative schedulers can offer a better performance/latency ratio for gaming and desktop use. The availability of each scheduler depends on the chosen Kernel version: the script will display what's available on a per-version basis.
Default tweaks
- Memory management and swapping tweaks
- Scheduling tweaks
CFS/EEVDFtweaks- Using the "Cake" network queue management system
- Using
vm.max_map_count=16777216by default - Cherry-picked patches from Clear Linux's patchset
Optional tweaks
The customization.cfg file offers many toggles for extra tweaks:
- NTsync,
FsyncandFutex2(deprecated) support: can improve the performance in games, needs a patched wine like wine-tkg - Graysky's per-CPU-arch native optimizations: tunes the compiled code to to a specified CPU
- Compile with GCC or Clang with optional
O2/O3andLTO(Clang only) optimizations.- Warning regarding DKMS modules prior to v3.0.2 (2021-11-21) and Clang:
DKMSversion v3.0.1 and earlier will default to using GCC, which will fail to build modules against a Clang-built kernel. This will - for example - break Nvidia drivers. Forcing olderDKMSto use Clang can be done but isn't recommended.
- Warning regarding DKMS modules prior to v3.0.2 (2021-11-21) and Clang:
- Using Modprobed-db's database can reduce the compilation time and produce a smaller kernel which will only contain the modules listed in it. NOT recommended
- Warning: make sure to read thoroughly about it first since it comes with caveats that can lead to an unbootable kernel.
- "Zenify" patchset using core blk, mm and scheduler tweaks from Zen
- Overrides for missing ACS capabilities
- OpenRGB support
- Provide own kernel
.configfile
User patches
To apply your own patch files using the provided scripts, you will need to put them in a linux<VERSION><PATCHLEVEL>-tkg-userpatches folder -- where VERSION and PATCHLEVEL are the kernel version and patch level, as specified in linux Makefile, the patch works on, e.g linux65-tkg-userpatches -- at the same level as the PKGBUILD file, with the .mypatch extension. The script will by default ask if you want to apply them, one by one. The option _user_patches should be set to true in the customization.cfg file for this to work.
Install procedure
For all the supported linux distributions, TKT has to be cloned with git. Since it keeps a clone of the kernel's sources within (linux-src-git, created during the first build after a fresh clone), it is recommended to keep the cloned TKT folder and simply update it with git pull, the install script does the necessary cleanup at every run.
Arch & derivatives
git clone --depth 1 https://github.com/ETJAKEOC/TKT.git
cd TKT
# Optional: edit the "customization.cfg" file
makepkg -si
The script will use a slightly modified Arch config from the TKT-config folder, it can be changed through the _configfile variable in customization.cfg. Th
