当前位置:网站首页>CGroup CPU group source code analysis
CGroup CPU group source code analysis
2022-07-05 06:38:00 【techtitan】
cpu group pick_next function
The following code comes from pick_next_task_fair
6739 /*
6740 * Because of the set_next_buddy() in dequeue_task_fair() it is rather
6741 * likely that a next task is from the same cgroup as the current.
6742 *
6743 * Therefore attempt to avoid putting and setting the entire cgroup
6744 * hierarchy, only change the part that actually changes.
6745 */
6746
6747 do {
6748 struct sched_entity *curr = cfs_rq->curr;
6749
6750 /*
6751 * Since we got here without doing put_prev_entity() we also
6752 * have to consider cfs_rq->curr. If it is still a runnable
6753 * entity, update_curr() will update its vruntime, otherwise
6754 * forget we've ever seen it.
6755 */
6756 if (curr) {
6757 if (curr->on_rq)
6758 update_curr(cfs_rq);
6759 else
6760 curr = NULL;
6761
6762 /*
6763 * This call to check_cfs_rq_runtime() will do the
6764 * throttle and dequeue its entity in the parent(s).
6765 * Therefore the nr_running test will indeed
6766 * be correct.
6767 */
6768 if (unlikely(check_cfs_rq_runtime(cfs_rq))) {
6769 cfs_rq = &rq->cfs;
6770
6771 if (!cfs_rq->nr_running)
6772 goto idle;
6773
6774 goto simple;
6775 }
6776 }
6777
6778 **se = pick_next_entity(cfs_rq, curr);**
6779 **cfs_rq = group_cfs_rq(se);**
6780 } while (cfs_rq);
279 /* runqueue "owned" by this group */
280 static inline struct cfs_rq *group_cfs_rq(struct sched_entity *grp)
281 {
282 return grp->my_q;
283 }
1) If cpu original rq pick_next_entity Choose right and wrong cgoup node , that 6779 Line return empty , namely my_q It's empty
2) If 6778 Row selected cgroup The root node of sched_entity, Then according to cgroup The hierarchy traverses once , To the last layer node sched_entity Of my_q It's empty , Is the real task entity
group share Calculation
4.19 calc_group_shares
边栏推荐
- [Gaode map POI stepping pit] amap Placesearch cannot be used
- 栈 AcWing 3302. 表达式求值
- Huawei bracelet, how to add medicine reminder?
- 4.Oracle-重做日志文件管理
- LSA Type Explanation - lsa-5 (type 5 LSA - autonomous system external LSA) and lsa-4 (type 4 LSA - ASBR summary LSA) explanation
- Vant weapp swippecell set multiple buttons
- 微信小程序路由再次跳轉不觸發onload
- H5内嵌App适配暗黑模式
- What is linting
- LSA Type Explanation - detailed explanation of lsa-2 (type II LSA network LSA) and lsa-3 (type III LSA network Summary LSA)
猜你喜欢
Chinese remainder theorem acwing 204 Strange way of expressing integers
4.Oracle-重做日志文件管理
5.Oracle-錶空間
7. Oracle table structure
There are three kinds of SQL connections: internal connection, external connection and cross connection
Alibaba's new member "Lingyang" officially appeared, led by Peng Xinyu, Alibaba's vice president, and assembled a number of core department technical teams
Redis-01.初识Redis
SolidWorks template and design library are convenient for designers to call
博弈论 AcWing 891. Nim游戏
达梦数据库全部
随机推荐
NVM Downloading npm version 6.7.0... Error
How to answer when you encounter a jet on CSDN?
Genesis builds a new generation of credit system
[QT] QT multithreading development qthread
5. Oracle TABLESPACE
Vant weapp swippecell set multiple buttons
The route of wechat applet jumps again without triggering onload
MySQL (UDF authorization)
【高德地图POI踩坑】AMap.PlaceSearch无法使用
H5内嵌App适配暗黑模式
论文阅读报告
Markdown syntax
容斥原理 AcWing 890. 能被整除的数
Redis-02. Redis command
Day 2 document
[Chongqing Guangdong education] 1185t administrative leadership reference test of National Open University in autumn 2018
Ffmpeg build download (including old version)
安装OpenCV--conda建立虚拟环境并在jupyter中添加此环境的kernel
[2020]GRAF: Generative Radiance Fields for 3D-Aware Image Synthesis
Application of recyclerview