当前位置:网站首页>20、 Processor scheduling (RR time slice rotation, mlfq multi-level feedback queue, CFS fully fair scheduler, priority reversal; multiprocessor scheduling)
20、 Processor scheduling (RR time slice rotation, mlfq multi-level feedback queue, CFS fully fair scheduler, priority reversal; multiprocessor scheduling)
2022-06-24 09:32:00 【[T]】
One 、 Simplified processor scheduling problem
Interrupt mechanism
1、 The processor is interrupted at a fixed frequency
(1)linux kernel It can be set to :100/250/300/1000Hz
2、 interrupt / When the system call returns, you can freely select the process / Threads
Simplified assumptions for processor scheduling problems
1、 There is a processor in the system
2、 There are multiple processes in the system / Thread sharing CPU
(1) system call ( process / Part of the thread code is in syscall In the implementation of )
(2) wait for I/O return , Do not apply CPU
Two 、 Strategy
1、RR(Round-Robin) Time slice rotation
2、 priority
(1)Unix niceness
-20 ~ 19
The bigger the value is. , Said to CPU The lower priority the resource gets
taskset -c 0 nice -n 19 yes > /dev/null &
taskset -c 0 nice -n 9 yes > /dev/null &
niceness The value difference of 10,CPU Poor resources 10 times
3、 Dynamic priority (MLFQ)
(1) Several RR queue
Each queue has a priority
(2) Dynamic priority adjustment strategy
Priority scheduling high priority queues
Use up the time slice -》NI Low value
4、CFS Completely fair scheduler
(1) Record the exact running time for each process
(2) interrupt / After the exception , Switch to the process with the least running time
Next time interrupt / After abnormality , The current process may not be the smallest
(3) Maintain collection
to update vrt(t)<- vrt(t)+dt
Take the smallest vrt
Process creation / sign out / sleep / Insert on wakeup / Delete t
3、 ... and 、 Processor scheduling
1、 Priority flipping
Low priority holds the lock waiting for high priority , Lead to high priority processes / The thread is by a low priority process / Thread blocking
(1) Priority inheritance , Low priority holds the same lock as high priority , Will inherit the priority of high priority
2、 Multiprocessor
(1) transfer ,cash Copying consumes resources
(2) Don't move , Can cause CPU waste ( It's hard for one core , Multi core onlookers )
3、 Single threaded tasks and multithreaded tasks CPU Possession problem
4、 Different types of cores (A55、A75、A78), To assign tasks, you need to know the core computing power
边栏推荐
- 解决:jmeter5.5在win11下界面上的字特别小
- Support vector machine (SVC, nusvc, linearsvc)
- Rpiplay implementation of raspberry pie airplay projector
- LeetCode: 137. 只出现一次的数字 II
- Applet wx show
- Ebanb B1 Bracelet brush firmware abnormal interrupt handling
- Time series data augmentation for deep learning: paper reading of a survey
- LeetCode: 377. 组合总和 Ⅳ
- Squid proxy application
- The native applet uses canvas to make posters, which are scaled to the same scale. It is similar to the uniapp, but the writing method is a little different
猜你喜欢
Event registration Apache pulsar x kubesphere online meetup hot registration
Time Series Data Augmentation for Deep Learning: A Survey 之论文阅读
[noi Simulation Competition] send (tree DP)
tp5 使用post接收数组数据时报variable type error: array错误的解决方法
Every (), map (), forearch () methods. There are objects in the array
[Niuke] length of the last word of HJ1 string
【bug】@JsonFormat 使用时出现日期少一天的问题
Target detection series fast r-cnn
2022.6.13-6.19 AI行业周刊(第102期):职业发展
Squid代理服务器应用
随机推荐
Go 语言项目开发实战目录
Zero foundation self-study SQL course | syntax sequence and execution sequence of SQL statements
Squid代理服务器应用
L01_ How is an SQL query executed?
tp5 使用post接收数组数据时报variable type error: array错误的解决方法
Epidemic situation, unemployment, 2022, we shouted to lie down!
P6117-[joi 2019 final] greedy
WindowManager 简单悬浮框的实现
Solution: the word of jmeter5.5 on the win11 lower interface is very small
ThinkPHP 5.0 模型关联详解
In depth analysis of Apache bookkeeper series: Part 3 - reading principle
threejs的 mmd模型加载+轮廓加载+动画加载+音频加载+相机动画加载+ammojs加载 gltf模型的加载 +gltf的反射调整
浮点数表示法(总结自CS61C和CMU CSAPP)
Linux MySQL installation
Jincang KFS replicator installation (oracle-kes)
LeetCode: 137. 只出现一次的数字 II
[noi simulation] pendulum (linear algebra, Du Jiao sieve)
PTA猴子选大王(约瑟夫环问题)
Redis实现全局唯一ID
Tools