有人对__update_curr做如下分析:[code]static inline void __update_curr(struct cfs_rq *cfs_rq, struct sched_entity *curr, unsigned long delta_exec) { /*更新cfs_rq->min_vruntime,它近似等于rb_tree中最左侧节点的vruntime. *实际情况是要比它稍微大一点. */ update_min_vruntime(cfs_rq); }[/code]update_min_vruntime源码如下:[code] 450static void update_min_vruntime(struct cfs_rq *cfs_rq) 45...
by embeddedlwp - 内核源码 - 2012-04-10 13:51:50 阅读(1079) 回复(4)
本帖最后由 embeddedlwp 于 2011-12-08 22:25 编辑 在scheduler函数中会调用put_prev_task_fair函数和pick_next_task_fair函数,其中put_prev_task_fair函数会调用到 put_prev_entity函数:[code] 833static void put_prev_entity(struct cfs_rq *cfs_rq, struct sched_entity *prev) 834{ 835 /* 836 * If still on the runqueue then deactivate_task() 837 * was not called and update_curr() h...
============= cfs Scheduler ============= 1. OVERVIEW cfs stands for "Completely Fair Scheduler," and is the new "desktop" process scheduler implemented by Ingo Molnar and merged in Linux 2.6.23. It is the replacement for the previous vanilla scheduler's SCHED_OTHER interactivity code. 80% of cfs's design can be summed up in a single sentence: cfs basically models an "ideal, precise multi-tas...
摘要:
本文结合contiki OS实例分析protothread四种状态:PT_WAITING、PT_YIELDED、PT_EXITED、PT_ENDED,并给出contiki事件相关函数与protothread状态,最后给出系统编程的参考API。
一、PT四种状态
摘要:
本文分析了contiki OS进程3种状态PROCESS_STATE_NONE、PROCESS_STATE_RUNNING、PROCESS_STATE_CALLED,并给出进程状态转换图。
一、进程状态概述
linux 2.6.29 cfs调度器中出现的buddy不知是什么,谁给我科普一下啊:[code] 722static void __clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se) 723{ 724 if (cfs_rq->last == se) 725 cfs_rq->last = NULL; 726 727 if (cfs_rq->next == se) 728 cfs_rq->next = NULL; 729}[/code][code]1368static void set_next_buddy(struct sched_entity *se) 1369{ 137...
本帖最后由 embeddedlwp 于 2011-12-08 22:24 编辑 Linux 2.6.29 cfs中的代码 entity_tick函数中会调用chek_preempt_tick检查是否应该重新调度:[code] 771check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) 772{ 773 unsigned long ideal_runtime, delta_exec; 774 775 ideal_runtime = sched_slice(cfs_rq, curr); 。。。。。。。 785}[/code][code] 427static u64 sched_slice...
cfs调度 by chishanmingshen 1.tick中断的调度 tick中断处理函数中,会取得当前cpu的rq,从而得到rq的current进程, 调用scheduler_tick()->task_tick_fair()->entity_tick(cfs_rq, se, queued). entity_tick()中更新cfs_rq,并判断抢占. 1.1先取得current所在的rq中处理对应的se. 1.2更新current所属的cfs_rq update_curr(cfs_rq) { /*算出current在上次tick中运行的时间:delta_exec, 记录标准的运行时间,所以加上delta_exec....