I have done this way too many times: randomly traverse make nconfig
and try to check boxes or disable stuff that seems fit.
I don't want to repeat this anymore, so I am recording the steps in this blog.
I'm using a thinkpad for music production, so latency is preferred over throughput.
At the time of writing, the computer spec is shown below:
OS: Gentoo 2.17 x86_64
Kernel: Linux 6.13.0-gentoo-ryan-thinkpad
CPU: AMD Ryzen 7 PRO 4750U (16) @ 1.70 GHz
GPU: AMD Radeon Vega Series / Radeon Vega Mobile Series [Integrated]
Memory: 5.81 GiB / 14.84 GiB (39%)
Swap: 55.04 MiB / 15.98 GiB (0%)
- Local version: set to some cool name
- Kernel compression mode: set to lz4 or
zstd
(faster) - Preemption Model: Scheduler controlled preemption model
- Fully Preemptible Kernel (Real-Time): Enable
- Disable Anything Intel (on AMD chip)
- Timer frequency (300 HZ): 1000Hz for real-time audio
- Cpuidle Driver for Intel Processors: Uncheck because of intel
- Enable workqueue power-efficient mode by default: Enable
- Link Time Optimization (LTO) (Clang ThinLTO (EXPERIMENTAL)): ThinLTO
- Module compression type:
zstd
This step enables compressed swap, and is only required for OS with swap enabled
- Support for paging of anonymous memory (swap)
- Enable the compressed cache for swap pages by default: Enable
- Default compressor:
zstd
- Default allocator:
zsmalloc
- Networking options
- TCP: advanced congestion control
- Disable everything other than BBR
- Set BBR as default TCP congestion control
- Amateur Radio support: Disable
- CAN bus subsystem support: Disable
- Plan 9 Resource Sharing Support (9P2000): Disable
- NFC subsystem support: Disable
- PCCard (PCMCIA/CardBus) support: Disable
- GNSS receiver support: Disable
- Memory Technology Device (MTD) support: Disable
- Parallel port support: Disable
- Block devices
- Compressed RAM block device support
- Uncheck everything other than zstd
- Default zram compressor: set to
zstd
- Track zRam block status: enable
- DRBD Distributed Replicated Block Device support: Disable
- ATA over Ethernet support: Disable
- Xen virtual block device support: Disable
- Xen block-device backend driver: Disable
- Rados block device: Disable
- RDMA Network Block Device driver: Disable
- Misc devices:
- Uncheck everything
- There might be something that can't be disabled. Go back here later.
- SCSI device support:
- SCSI low-level drivers: Disable everything
- Generic Target Core Mod (TCM) and ConfigFS Infrastructure: Disable
- Fusion MPT device support: Disable
- IEEE 1394 (FireWire) support
- Macintosh device drivers: Disable
- Network device support:
- ATM drivers: Disable
- Distributed Switch Architecture drivers
- Ethernet driver support
- Disable everyting other than on your board, use
lspci -vvv | grep -i eth
- PPP (point-to-point protocol) support: Disable
- SLIP (serial line) support: Disable
- Wireless LAN:
- Use
lspci -vvv | grep -i netw
and google to filter out un-needed wlan driver
- IEEE 802.15.4 drivers: Disable
- UJITSU Extended Socket Network Device driver: Disable
- Pin Controllers:
- Remove Anything Intel (On AMD platform)
- GPIO Support:
- For every drivers, or expanders, remove Anything Intel (On AMD platform)
- Dallas's 1-wire support: Disable
- Sonics Silicon Backplane support: Disable
- Broadcom specific AMBA: Disable
- Remote Controller support: Disable
- Graphics support:
- Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)
- Disable drivers not for this computer (Radeon, Nouveau, Intel)
- Compute Acceleration Framework: Disable
- Sound card support:
- Advanced Linux Sound Architecture
- PCI sound devices
- use
lsmod | grep snd
to filter out devices
- MMC/SD/SDIO card support: Disable, then uncheck content in
Misc devices
- Universal Flash Storage Controller: Disable
- Sony MemoryStick card support: Disable
- InfiniBand support: Disable
- Staging drivers: Disable
- Platform support for Chrome hardware: Disable
- Platform support for Mellanox hardware: Disable
- Non-Transparent Bridge support: Disable
- Industrial I/O support: Disable
- Pulse-Width Modulation (PWM) Support: Disable
- Restrict unprivileged access to the kernel syslog: Enable
- Support for init systems, system and service managers