RT总结

背景介绍:机器人整个通信系统对RT是有要求的,基于linux的RT有多种方案。

以下是学习时留下的网址资料。

http://linuxrealtime.org/index.php/Main_Page

http://linuxrealtime.org/index.php/Designing_Real-Time_Applications

http://linuxrealtime.org/index.php/Improving_the_Real-Time_Properties

http://linuxrealtime.org/index.php/Improving_the_Real-Time_Properties#Isolating_the_Application  !!!  https://github.com/OpenEneaLinux/rt-tools

http://wiki.linuxcnc.org/cgi-bin/wiki.pl?RealTime

http://linuxrealtime.org/index.php/Improving_the_Real-Time_Properties

方案1:(该方案也有局限性,但是相对通用,也易于使用,同时使用某个测试测过,感觉还可以【下面讲述的某个测试用例测过,忘记那个了】)

1、怎么构建RT的应用

https://rt.wiki.kernel.org/index.php/HOWTO:_Build_an_RT-application

https://rt.wiki.kernel.orgs/index.php/HOWTO:_Build_an_RT-application

https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO

https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO#A_Realtime_.22Hello_World.22_Example

https://www.spinics.net/lists/linux-rt-users/msg05426.html

https://www.rtai.org

2、绑定CPU

<1>进程绑定isolcpus

CPU隔离,只运行指定的进程。

isolcpus=2,3, update-grub2

<2>中断绑定

irqbalance的IRQBALANCE_BANNED_CPUS在ubuntu不工作,见官网,所以需要使用smp_affinity

sudo for f in `find . -name "smp_affinity"`; do echo "3" > $f; done

(也可以研究下中断相关的,可以在isolcpus的cpu上禁止无用中断)

2.1优先级renice

nice chrt taskset

2.2  BIOS

power management disable

hyper threading  disable

2.4 cgroup

3、内存禁止交换

4、直接写的PCIE的驱动(非网卡),没有用uio,直接mmap的各种内存。驱动zerocopy, DMA

方案2:

RT_preempt,抖动比较厉害,下个源码打个补丁。(尽量是厂商的源码,不要去org下载一个)

方案3:

xenomai-3,专用内核,也尝试过,感觉有点不好用,因为上层应用还是希望通用性好(ROS等)

后续

RTnet打算研究下,为网络方式通信打基础。

你可能感兴趣的:(RT总结)