ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

调度器16—core_ctl

2021-12-06 17:02:23  阅读:431  来源: 互联网

标签:core rw 16 cpus cluster ctl root


基于MTK Linux-5.10

一、相关文件接口

1. parameters文件接口

/sys/module/mtk_core_ctl/parameters # ls -l
-rw------- 1 root   root   debug_enable //控制 core_ctl.c 中 core_ctl_debug() 的打印,TAG为"core_ctl"
-rw-rw---- 1 system system policy_enable

(1) debug_enable

默认为false, 控制 core_ctl.c 中 core_ctl_debug() 的打印,TAG为"core_ctl"

(2) policy_enable

默认为false, 从 demand_eval() 来看,若 policy_enable 文件没有使能的话,那么 need_cpus 直接取 cluster->max_cpus,此时cpu核的isolate/ioslate只受用户空间通过core_ctl下面的文件节点和是否boost进行设置了。

 

2. core_ctl文件接口

/sys/devices/system/cpu/cpu0/core_ctl # ls -l
-rw------- 1 root root core_ctl_boost
-rw------- 1 root root enable
-r-------- 1 root root global_state
-rw-rw-r-- 1 root root max_cpus
-rw-rw-r-- 1 root root min_cpus
-rw------- 1 root root not_preferred
-rw------- 1 root root offline_throttle_ms
-r-------- 1 root root ppm_state //显示一个表
-r-------- 1 root root thermal_up_thres
-rw------- 1 root root up_thres

(1) core_ctl_boost

对应 cluster_data::boost 成员,默认是false,设置为1是对所有cluster进行boost,在 demand_eval() 中判断,若是boot状态的话,need_cpus 直接取 cluster->max_cpus,也就是不再执行实际的isolate动作了,若是有isolate的cpu,需要unisolate。

(2) enable

对应 cluster_data::enable 成员,默认是true,在 demand_eval() 中判断,若是没有enable的话,need_cpus 直接取 cluster->max_cpus,也就是不再执行实际的isolate动作了,若是有isolate的cpu,需要unisolate。

(3) global_state

打印cluster中cpu的Active cpu个数,Need cpu个数,Paused cpu个数,以及cluster内各个cpu的 oneline、pause、busy、prefer 状态,见下面cat的内容。

(4) max_cpus

对应 cluster_data::max_cpus 成员,线程do_core_ctl()中在执行实际isolate/unisolate之前会先执行 apply_limits(cluster, cluster->need_cpus) 将 need_cpus 钳制在 cluster->min_cpus 和 cluster->max_cpus 之间,也就是说默认逻辑会尊重用户空间对cpu核数的限制,用户空间的限制优先级最高,高于 core_ctl_tick() 执行逻辑中预估的核数。但是通过 eas_ioctl 文件设置下来的不在尊重用户空间对cpu的限制了。

(5) min_cpus

对应 cluster_data::min_cpus 成员,各个cluster默认取值default_min_cpus[MAX_CLUSTERS] = {4, 2, 0}。设置后立即唤醒"core_ctl_v2/X"线程执行isolate/unisolate操作。

(6) not_preferred

对应 cluster_data::not_preferred 成员,如果标记了某些CPU是not_preferred,那么在 try_to_pause() 中 isolate CPU的时候就会优先isolate这些not_preferred的CPU,若是not_preferred的CPU都已经isolated了还没达到 active_cpus == need 这个条件,那么就继续isolate没有被标记为not_preferred的CPU。

 

标签:core,rw,16,cpus,cluster,ctl,root
来源: https://www.cnblogs.com/hellokitty2/p/15650680.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有