- 论坛徽章:
- 0
|
本帖最后由 wenkai169 于 2014-02-11 09:47 编辑
mordorwww 发表于 2014-02-10 08:56
scheduler_tick到底做不做调度
弄错了,他只触发了调度,自己没有去操作。
源码里面- void scheduler_tick(void) {
- ...
- #ifdef CONFIG_SMP
- rq->idle_balance = idle_cpu(cpu);
- trigger_load_balance(rq, cpu);
- #endif
- }
- /*
- * Trigger the SCHED_SOFTIRQ if it is time to do periodic load balancing.
- */
- void trigger_load_balance(struct rq *rq, int cpu)
- {
- /* Don't need to rebalance while attached to NULL domain */
- if (time_after_eq(jiffies, rq->next_balance) &&
- likely(!on_null_domain(cpu)))
- raise_softirq(SCHED_SOFTIRQ);
- #ifdef CONFIG_NO_HZ_COMMON
- if (nohz_kick_needed(rq, cpu) && likely(!on_null_domain(cpu)))
- nohz_balancer_kick(cpu);
- #endif
- }
复制代码 |
|