当前位置: 首页 > news >正文

update_min_vruntime()流程图

linux kernel scheduler cfs的update_min_vruntime() 看起来还挺绕的。含义其实也简单,总一句话,将 cfs_rq->min_vruntime 设置为:

max( cfs_rq->vruntime,  min(leftmost_se->vruntime, cfs_rq->curr->vruntime) )。

画个流程图,给它整个明明白白。

// 将 cfs_rq->min_vruntime 更新为 min(leftmost_se->vruntime, cfs_rq->curr->vruntime)
static void update_min_vruntime(struct cfs_rq *cfs_rq)
{struct sched_entity *curr = cfs_rq->curr;struct rb_node *leftmost = rb_first_cached(&cfs_rq->tasks_timeline);u64 vruntime = cfs_rq->min_vruntime;if (curr) {if (curr->on_rq)vruntime = curr->vruntime;elsecurr = NULL;}if (leftmost) { /* non-empty tree */struct sched_entity *se = __node_2_se(leftmost);if (!curr)vruntime = se->vruntime;elsevruntime = min_vruntime(vruntime, se->vruntime);}/* ensure we never gain time by being placed backwards. */cfs_rq->min_vruntime = max_vruntime(cfs_rq->min_vruntime, vruntime);
#ifndef CONFIG_64BITsmp_wmb();cfs_rq->min_vruntime_copy = cfs_rq->min_vruntime;
#endif
}

http://www.lryc.cn/news/342643.html

相关文章:

  • 十进制转任意进制(以及任意进制来回转换<了解>)
  • postcss-px-to-viewport 从入坑到放弃 (nuxt3搭建响应式官网解决方案 )
  • C语言从入门到入门
  • Java基础教程 - 4 流程控制
  • 大厂Java面试题:MyBatis中有几种加载映射器(Mapper.xml)的方式?
  • Flutter笔记:Widgets Easier组件库(10)快速处理承若型对话
  • 10_Linux中的计划任务
  • Google Play开发者账号为什么会被封?如何解决关联账号问题?
  • (第12天)【leetcode题解】151、反转字符串中的单词
  • 如何处理多模态数据噪声不均衡动态?天大等最新《低质量数据的多模态融合》综述
  • Autosar NvM配置-手动配置Nvblock及使用-基于ETAS软件
  • 【c++算法篇】双指针(下)
  • 微图乐 多种装B截图一键制作工具(仅供娱乐交流)
  • 基于Springboot的点餐平台
  • C# 获取一个字符串中非数字部分?
  • 今日总结2024/5/7
  • 爬虫学习(3)豆瓣电影
  • GNU Radio创建FFT、IFFT C++ OOT块
  • 125.两两交换链表中的节点(力扣)
  • APP精准推送广告是怎么做到的?
  • RapidJSON介绍
  • 大型企业总分支多区域数据传输,效率为先还是安全为先?
  • C语言例题35、反向输出字符串(指针方式),例如:输入abcde,输出edcba
  • 场景文本检测识别学习 day09(Swin Transformer论文精读)
  • 抖音小店个人店和个体店有什么不同?区别问题,新手必须了解!
  • 动态规划入门和应用示例
  • 【C语言】精品练习题
  • 数据库(MySQL)—— DML语句
  • 【最大公约数 并集查找 调和级数】1998. 数组的最大公因数排序
  • iOS实现一个高性能的跑马灯