免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3182 | 回复: 6
打印 上一主题 下一主题

Linux realtime-preempt [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-11-22 14:02 |只看该作者 |倒序浏览
在man sched_setscheduler中看到:
From  kernel version 2.6.18 onwards, however, Linux is gradually becoming equipped with real-time capabilities, most  of  which  are  derived from  the  former  realtime-preempt  patches  developed by Ingo Molnar,
       Thomas Gleixner, Steven Rostedt, and others.  Until  the  patches  have been completely merged into the mainline kernel (this is expected to be around kernel version 2.6.30), they must be installed  to  achieve  the  best real-time performance.
请问各位内核大牛:现在(2.6.38-8)Linux的实时抢占部分的patches是否已经被融入了内核,也就是现在不用手动打patch了? 谢谢!

论坛徽章:
0
2 [报告]
发表于 2011-11-22 14:24 |只看该作者
阅读20,回复0. 难道没有人知道吗?

论坛徽章:
0
3 [报告]
发表于 2011-11-22 16:44 |只看该作者
回复 1# digdeep126

里面有说可以在2.6.30合并完毕,不是吗?
现在的内核mainline是:3.2-rc2

论坛徽章:
0
4 [报告]
发表于 2011-11-22 18:25 |只看该作者
回复 3# wangjianchangdx
this is expected to be around kernel version 2.6.30 ==>> 预期会在2.6.30合并,但是谁知道是否真的合并了呢?而且那个patch还是在路径 http://www.kernel.org/pub/linux/kernel/projects/rt/ 里面,似乎没有合并。而且我测试了一下:
  1. #include <stdio.h>
  2. #include <sched.h>
  3. #include <unistd.h>

  4. int main()
  5. {
  6.         struct sched_param      para;
  7.         int     sched;

  8.         para.sched_priority = 20;
  9.         if(sched_setscheduler(getpid(), SCHED_FIFO, &para) != 0){
  10.                 printf("don't have realtime-preempt.\n");
  11.         }else{
  12.                 printf("already have realtime-preempt.\n");
  13.         }
  14.         sched = sched_getscheduler(getpid());
  15.         printf("thread_routine running at %s\n",
  16.         (sched == SCHED_FIFO ? "FIFO"
  17.             : (sched == SCHED_RR ? "RR"
  18.             : (sched == SCHED_OTHER ? "OTHER" : "unknown"))));

  19.         return 0;
  20. }
复制代码
运行结果:
don't have realtime-preempt.
thread_routine running at OTHER

论坛徽章:
1
拜羊年徽章
日期:2015-03-03 16:15:43
5 [报告]
发表于 2011-11-22 20:09 |只看该作者
系统配置时, 有preempt的选项, 选上没有?

论坛徽章:
0
6 [报告]
发表于 2011-11-22 20:36 |只看该作者
本帖最后由 digdeep126 于 2011-11-22 20:53 编辑
系统配置时, 有preempt的选项, 选上没有?
linuxfellow 发表于 2011-11-22 20:09


请问如何配置preempt?我用的是Ubuntu 11.04

在网上找到了一些资料。谢谢linuxfellow的提示!

论坛徽章:
0
7 [报告]
发表于 2015-11-11 14:18 |只看该作者
我所看到的是不会这么早合并,或者说又另开炉灶。目前PREEMPT-RT已经支持到4.×了,我现在在移植其3.14.×的补丁,但在网上搜刮后发现,这些
补丁并不能做到100%的硬实时,而若要软实时,不打补丁在内核配置里面是可以选择的了,效果比未开配置好一点点。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP