KVER=6.5.2
RTVER=8
mkdir kernel && cd kernel
wget https://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/linux-${KVER}.tar.gz
wget https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/6.5/patch-${KVER}-rt${RTVER}.patch.gz
tar xzf linux-${KVER}.tar.gz
cd linux-${KVER}
gzip -cd ../patch-${KVER}-rt${RTVER}.patch.gz|patch -p1
cp -v /boot/config-$(uname -r) .config
yes '' | make oldconfig
make menuconfig
and set the following:
# Enable CONFIG_PREEMPT_RT
-> General Setup
-> Preemption Model (Fully Preemptible Kernel (Real-Time))
(X) Fully Preemptible Kernel (Real-Time)
# Enable CONFIG_HIGH_RES_TIMERS
-> General setup
-> Timers subsystem
[*] High Resolution Timer Support
# Enable CONFIG_NO_HZ_FULL
-> General setup
-> Timers subsystem
-> Timer tick handling (Full dynticks system (tickless))
(X) Full dynticks system (tickless)
# Set CONFIG_HZ_1000 (note: this is no longer in the General Setup menu, go back twice)
-> Processor type and features
-> Timer frequency (1000 HZ)
(X) 1000 HZ
# Set CPU_FREQ_DEFAULT_GOV_PERFORMANCE [=y]
-> Power management and ACPI options
-> CPU Frequency scaling
-> CPU Frequency scaling (CPU_FREQ [=y])
-> Default CPUFreq governor (<choice> [=y])
(X) performance
Save and Exit menuconfig, then disable kernel signing:
scripts/config --disable SYSTEM_TRUSTED_KEYS
scripts/config --disable SYSTEM_REVOCATION_KEYS
Finally, make then install generatd packages:
make -j8 bindeb-pkg
sudo dpkg -i ../*.deb
Then have a look at https://wiki.linuxfoundation.org/realtime/documentation/howto/applications/application_base.