Xenomai thread migration

Xenomai中的任务需要通过以下方式显示声明CPU迁移, 否则系统不会主动进行迁移。

原因是迁移本身会带来延迟,系统决定不去做迁移的判断。


参考:

http://www.xenomai.org/pipermail/xenomai/2013-September/029248.html

> Or is there a complex algorithm to determine who is in a processor in a
> instance ?

No complex algorithm at all. A Xenomai thread is given a static affinity
when it emerges, based on the one linux chose when cloning the new task.
Then the Xenomai app may chose to change that affinity, using the
relevant API calls (i.e. sched_setaffinity for the POSIX one). Xenomai
will notice and maintain consistency between schedulers.

At any rate, Xenomai deliberately refrains from doing any dynamic load
balancing over CPUs, because this is a latency killer
(resuming from a
cold cache, cost of the migration process and so on). If a Xenomai
thread wants to move to another CPU, it has to request it explicitly.
We don't know how to do CPU migration efficiently wrt latency, so we
don't do it, and accept dumbness.

http://comments.gmane.org/gmane.linux.real-time.xenomai.devel/1903

> Or we can get rid of xnpod_migrate_thread(), it is currently not used by
> any skin.
> 

It's a fundamental feature for placing SMP jobs, and kernel-based
Xenomai threads could not rely on sched_setscheduler() to do it. Let's
keep this service, and simply pass the sched pointer to the accumulation
routine; I was wrong initially suggesting the opposite. IOW, let's avoid
smashing a squadron of flies with nukes...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值