Skip to content
KERNEL_CHANGES.md 5.42 KiB
Newer Older
# Kernel Changes
Melroy van den Berg's avatar
Melroy van den Berg committed
See below the sub-sections and for each section the **changes** that are done in the Kernel Config.

## General setup

# Set custom kernel version

CONFIG_LOCALVERSION="melvalds-1.3"
## General setup -> Preemption Model

```conf
# Enable Fully Preemptible Kernel (real-time)!
CONFIG_PREEMPT_LAZY=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set
CONFIG_PREEMPT_RT=y

## RCU Subsystem

```conf
# Enable PREEMPT_RCU

CONFIG_PREEMPT_RCU=y
CONFIG_RCU_EXPERT=y

CONFIG_RCU_FANOUT=64
CONFIG_RCU_FANOUT_LEAF=16
# CONFIG_RCU_FAST_NO_HZ is not set
CONFIG_RCU_BOOST=y
CONFIG_RCU_BOOST_DELAY=0
CONFIG_RCU_NOCB_CPU=y
# CONFIG_TASKS_TRACE_RCU_READ_MB is not set
```

## Processor type and features

```conf
# Just support X86 CPUs (the majority)
# And Increase the timer interrupt frequency to 1000HZ

# CONFIG_X86_EXTENDED_PLATFORM is not set

# CONFIG_HZ_250 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000
## Device Drivers 
# Disable some kernel modules, you don't need on a desktop PC
# CONFIG_MFD_CROS_EC is not set
# CONFIG_CHROME_PLATFORMS is not set
```

### -> X86 Platform Specific Device Drivers
```conf
# Disable even more modules; all laptops modules and related modules;
#  don't use a laptop for gaming/real-time apps, use a decent desktop PC.

# CONFIG_I8K is not set
# CONFIG_ALIENWARE_WMI is not set
# CONFIG_HUAWEI_WMI is not set
# CONFIG_XIAOMI_WMI is not set
# CONFIG_ACERHDF is not set
# CONFIG_ACER_WIRELESS is not set
# CONFIG_ACER_WMI is not set
# CONFIG_ASUS_LAPTOP is not set
# CONFIG_ASUS_WIRELESS is not set
# CONFIG_ASUS_WMI is not set
# CONFIG_EEEPC_LAPTOP is not set
# CONFIG_DELL_LAPTOP is not set
# CONFIG_DELL_WMI is not set
# CONFIG_FUJITSU_LAPTOP is not set
# CONFIG_FUJITSU_TABLET is not set
# CONFIG_HP_ACCEL is not set
# CONFIG_HP_WIRELESS is not set
# CONFIG_HP_WMI is not set
# CONFIG_IDEAPAD_LAPTOP is not set
# CONFIG_SENSORS_HDAPS is not set
# CONFIG_THINKPAD_ACPI is not set
# CONFIG_INTEL_ATOMISP2_LED is not set
# CONFIG_INTEL_ATOMISP2_PM is not set
# CONFIG_INTEL_CHT_INT33FE is not set
# CONFIG_INTEL_HID_EVENT is not set
# CONFIG_INTEL_INT0002_VGPIO is not set
# CONFIG_INTEL_MENLOW is not set
# CONFIG_INTEL_OAKTRAIL is not set
# CONFIG_INTEL_VBTN is not set
# CONFIG_SURFACE3_WMI is not set
# CONFIG_SURFACE_3_BUTTON is not set
# CONFIG_SURFACE_3_POWER_OPREGION is not set
# CONFIG_SURFACE_PRO3_BUTTON is not set
# CONFIG_MSI_LAPTOP is not set
# CONFIG_MSI_WMI is not set
# CONFIG_PCENGINES_APU2 is not set
# CONFIG_SAMSUNG_LAPTOP is not set
# CONFIG_SAMSUNG_Q10 is not set
# CONFIG_ACPI_TOSHIBA is not set
# CONFIG_TOSHIBA_BT_RFKILL is not set
# CONFIG_TOSHIBA_HAPS is not set
# CONFIG_TOSHIBA_WMI is not set
# CONFIG_ACPI_CMPC is not set
# CONFIG_COMPAL_LAPTOP is not set
# CONFIG_LG_LAPTOP is not set
# CONFIG_PANASONIC_LAPTOP is not set
# CONFIG_SONY_LAPTOP is not set
# CONFIG_SYSTEM76_ACPI is not set
# CONFIG_TOPSTAR_LAPTOP is not set
# CONFIG_TOUCHSCREEN_DMI is not set

## Power management and ACPI options

```conf
# Disable suspend features (I hate suspend), also therefor tracing is not needed anymore

# CONFIG_SUSPEND is not set
# CONFIG_PM_TRACE_RTC is not set
### -> CPU Frequency scaling
```conf
# Disable the two lowest power saving options (switching between CPU frequency scales takes time, causing latencies)

# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
## General architecture-dependent options

```conf
# Enabling Architecture support RT is done automatically; when using a RT kernel branch

CONFIG_ARCH_SUPPORTS_RT=y
```

## Networking support

### -> Networking options -> TCP/IP networking

```conf
# Improve network speeds
Melroy van den Berg's avatar
Melroy van den Berg committed
# Enable Google BBR TCP protocol (instead of cubic) as default congestion control

CONFIG_TCP_CONG_CUBIC=m
CONFIG_TCP_CONG_BBR=y
CONFIG_DEFAULT_BBR=y
CONFIG_DEFAULT_TCP_CONG="bbr"

# Enable also Multipath TCP for IPv6
CONFIG_MPTCP=y
CONFIG_INET_MPTCP_DIAG=m
CONFIG_MPTCP_IPV6=y
### -> Networking options -> QoS and/or fair queueing
Melroy van den Berg's avatar
Melroy van den Berg committed

```conf
Melroy van den Berg's avatar
Melroy van den Berg committed
# Enable Propertial Integral Controller Enhanced module: rfc8033, addressing the Bufferbloat problem,
#  and make FQ-PIE default.

CONFIG_NET_SCH_FQ_PIE=y
CONFIG_NET_SCH_DEFAULT=y
# CONFIG_DEFAULT_FQ is not set
# CONFIG_DEFAULT_CODEL is not set
# CONFIG_DEFAULT_FQ_CODEL is not set
CONFIG_DEFAULT_FQ_PIE=y
# CONFIG_DEFAULT_SFQ is not set
# CONFIG_DEFAULT_PFIFO_FAST is not set
CONFIG_DEFAULT_NET_SCH="fq_pie"
## Device Drivers 

### -> DMA Engine support 
Melroy van den Berg's avatar
Melroy van den Berg committed

```conf
# Enable all direct access memory modules

CONFIG_INTEL_IDXD=m
CONFIG_PLX_DMA=m
CONFIG_XILINX_ZYNQMP_DPDMA=m
CONFIG_SF_PDMA=m
```

### -> DMABUF options
Melroy van den Berg's avatar
Melroy van den Berg committed

```conf
Melroy van den Berg's avatar
Melroy van den Berg committed
# DMA buffer shared between drivers in Userland, System heap and CMA heap 
Melroy van den Berg's avatar
Melroy van den Berg committed

CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_HEAPS_SYSTEM=y
CONFIG_DMABUF_HEAPS_CMA=y
```
## Kernel hacking

```conf
# Disable debugging of the preemptible kernel, get no overhead by debug features.
#  And disable debugging malicious code as well.

# CONFIG_DEBUG_PREEMPT is not set
# CONFIG_DEBUG_MISC is not set
```

### -> Compile-time checks and compiler options

```conf
# Disable debug explicitly, so no dbg packages are created

CONFIG_DEBUG_INFO=n
```

### -> Generic Kernel Debugging Instruments

```conf
# Disable remote kernel debugging

# CONFIG_KGDB is not set
```

### -> x86 Debugging

```conf
# Change to ORC unwinder (iso frame pointer), which increase performance because the debuginfo is out of band

CONFIG_UNWINDER_ORC=y
# CONFIG_UNWINDER_FRAME_POINTER is not set
```