KERNEL_CHANGES.md 5.42 KB
Newer Older
1
# Kernel Changes
2

Melroy van den Berg's avatar
Melroy van den Berg committed
3
See below the sub-sections and for each section the **changes** that are done in the Kernel Config.
Melroy van den Berg's avatar
Melroy van den Berg committed
4
5
6

## General setup

7
```conf
Melroy van den Berg's avatar
Melroy van den Berg committed
8
9
# Set custom kernel version

10
CONFIG_LOCALVERSION="melvalds-1.3"
Melroy van den Berg's avatar
Melroy van den Berg committed
11
```
12

13
14
## General setup -> Preemption Model

Melroy van den Berg's avatar
Melroy van den Berg committed
15
```conf
16
# Enable Fully Preemptible Kernel (real-time)!
17

18
CONFIG_PREEMPT_LAZY=y
19
# CONFIG_PREEMPT_VOLUNTARY is not set
20
21
# CONFIG_PREEMPT is not set
CONFIG_PREEMPT_RT=y
Melroy van den Berg's avatar
Melroy van den Berg committed
22
```
23
24
25

## RCU Subsystem

Melroy van den Berg's avatar
Melroy van den Berg committed
26
```conf
27
28
29
30
31
32
33
34
35
36
37
38
# 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
Melroy van den Berg's avatar
Melroy van den Berg committed
39
40
41
42
43
44
```

## Processor type and features

```conf
# Just support X86 CPUs (the majority)
45
# And Increase the timer interrupt frequency to 1000HZ
Melroy van den Berg's avatar
Melroy van den Berg committed
46
47

# CONFIG_X86_EXTENDED_PLATFORM is not set
48
49
50
51

# CONFIG_HZ_250 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000
Melroy van den Berg's avatar
Melroy van den Berg committed
52
53
```

54
## Device Drivers 
Melroy van den Berg's avatar
Melroy van den Berg committed
55
56

```conf
57
# Disable some kernel modules, you don't need on a desktop PC
Melroy van den Berg's avatar
Melroy van den Berg committed
58

59
60
61
62
63
# CONFIG_MFD_CROS_EC is not set
# CONFIG_CHROME_PLATFORMS is not set
```

### -> X86 Platform Specific Device Drivers
Melroy van den Berg's avatar
Melroy van den Berg committed
64

65
66
```conf
# Disable even more modules; all laptops modules and related modules;
Melroy van den Berg's avatar
Melroy van den Berg committed
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#  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
90
91
92
93
94
95
96
97
# 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
Melroy van den Berg's avatar
Melroy van den Berg committed
98
# CONFIG_SURFACE3_WMI is not set
99
100
101
# CONFIG_SURFACE_3_BUTTON is not set
# CONFIG_SURFACE_3_POWER_OPREGION is not set
# CONFIG_SURFACE_PRO3_BUTTON is not set
Melroy van den Berg's avatar
Melroy van den Berg committed
102
103
# CONFIG_MSI_LAPTOP is not set
# CONFIG_MSI_WMI is not set
104
# CONFIG_PCENGINES_APU2 is not set
Melroy van den Berg's avatar
Melroy van den Berg committed
105
106
107
108
109
# 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
110
# CONFIG_TOSHIBA_WMI is not set
Melroy van den Berg's avatar
Melroy van den Berg committed
111
112
113
114
115
# 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
116
# CONFIG_SYSTEM76_ACPI is not set
Melroy van den Berg's avatar
Melroy van den Berg committed
117
# CONFIG_TOPSTAR_LAPTOP is not set
118
# CONFIG_TOUCHSCREEN_DMI is not set
Melroy van den Berg's avatar
Melroy van den Berg committed
119
```
120
121
122

## Power management and ACPI options

Melroy van den Berg's avatar
Melroy van den Berg committed
123
```conf
124
125
126
127
# 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
Melroy van den Berg's avatar
Melroy van den Berg committed
128
```
129

130
### -> CPU Frequency scaling
131

Melroy van den Berg's avatar
Melroy van den Berg committed
132
```conf
133
134
135
136
# 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
Melroy van den Berg's avatar
Melroy van den Berg committed
137
138
```

139
140
141
142
143
144
145
146
147
148
149
## 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
Melroy van den Berg's avatar
Melroy van den Berg committed
150
151
152

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

CONFIG_TCP_CONG_CUBIC=m
CONFIG_TCP_CONG_BBR=y
CONFIG_DEFAULT_BBR=y
CONFIG_DEFAULT_TCP_CONG="bbr"
159
160
161
162
163

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

```conf
Melroy van den Berg's avatar
Melroy van den Berg committed
168
169
170
171
172
173
174
175
176
177
178
179
# 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"
Melroy van den Berg's avatar
Melroy van den Berg committed
180
181
```

182
183
184
## Device Drivers 

### -> DMA Engine support 
Melroy van den Berg's avatar
Melroy van den Berg committed
185
186
187
188
189
190
191
192
193
194

```conf
# Enable all direct access memory modules

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

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

```conf
Melroy van den Berg's avatar
Melroy van den Berg committed
198
# DMA buffer shared between drivers in Userland, System heap and CMA heap 
Melroy van den Berg's avatar
Melroy van den Berg committed
199
200
201
202
203

CONFIG_DMABUF_HEAPS=y
CONFIG_DMABUF_HEAPS_SYSTEM=y
CONFIG_DMABUF_HEAPS_CMA=y
```
Melroy van den Berg's avatar
Melroy van den Berg committed
204

205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
## 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
Melroy van den Berg's avatar
Melroy van den Berg committed
232
233
234
235
236
237
238

```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
```