如何在Ubuntu中启用CONFIG_RT_GROUP_SCHED使其成为RT [英] How to enable CONFIG_RT_GROUP_SCHED in Ubuntu to make it RT
问题描述
我需要在Ubuntu RT Linux上运行实时应用程序,并且正在阅读有关使Linux充当RT系统的方法,并且我学习了两种方法来实现
- preemptive_rt内核修补程序
- 在内核中启用
CONFIG_RT_GROUP_SCHED
标志.
我已经尝试过第一种方法
转到常规设置
─> 内核.config支持
,并允许通过/proc/config.gz访问
.config
第7步
编译内核
$ make -j20
制作模块和安装
<代码> $ sudo make modules_install -j20$ sudo make install -j20
第8步
打开 grub.cfg
文件以验证是否已安装内核
<代码> $ vim/boot/grub/grub.cfg
使用菜单'Ubuntu,使用Linux linux-4.16.18'查找菜单项
如果它不是您的默认内核,则将 GRUB_DEFAULT = 0
的值更改为您的内核
第9步
重新启动系统
sudo重新启动
第10步
通过以下命令验证系统:
#zcat/proc/config.gz |grep RT_GROUPCONFIG_RT_GROUP_SCHED = y
I need to run real time applications on Ubuntu RT Linux and was reading about ways to make linux act as RT system and I learned two ways to do it
- preemptive_rt kernel patching
- enabling
CONFIG_RT_GROUP_SCHED
flag in the kernel.
I've already tried my hands on 1st method Install RT Linux patch for Ubuntu
However, apart from uname -r
showing #1 SMP PREEMPT RT
I've no other proof that it is actually a RT system and hence want to try the 2nd method. Enable CONFIG_RT_GROUP_SCHED
flag in the kernel and see its performance.
I read we can confirm if the kernel already has the flag by following command:
# zcat /proc/config.gz | grep RT_GROUP
CONFIG_RT_GROUP_SCHED=y
However, my system doesn't even have the config.gz file in proc, so I believe my kernel does not have this enabled. I'm relatively new to linux kernels so this might be naive but how can I enable this in the kernel?
Step 1
Download linux kernel from https://www.kernel.org/pub/linux/kernel/. For the purpose of this PoC we downloaded linux-4.16.18.tar.gz
kernel from above link.
Step 2 Unzip the kernel
$ tar -xzvf linux-4.16.18.tar.gz
Step 3
Move to kernel source directory
$ cd linux-4.16.18
Step 4
Install kernel build dependencies
$ sudo apt install git build-essential kernel-package fakeroot libncurses5-dev libssl-dev ccache bison flex
Step 5
Run kernel configuration
$make menuconfig
Step 6
Go to General setup
─> Control Group Support
─> CPU controller
─> Group scheduling for SCHED_RR/FIFO
configuration as shown below:
Go to General setup
─> Kernel .config support
and enable access to .config
through /proc/config.gz
Step 7
Compile the kernel
$ make -j20
Make modules & install
$ sudo make modules_install -j20
$ sudo make install -j20
Step 8
Open the grub.cfg
file to verify if kernel is installed
$ vim /boot/grub/grub.cfg
Look for the menuentry with menuentry 'Ubuntu, with Linux linux-4.16.18'
If it's not your default kernel then change the GRUB_DEFAULT=0
value to your kernel
Step 9
Reboot your system
sudo reboot
Step 10
Verify the system by the following command:
# zcat /proc/config.gz | grep RT_GROUP
CONFIG_RT_GROUP_SCHED=y
这篇关于如何在Ubuntu中启用CONFIG_RT_GROUP_SCHED使其成为RT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!