We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3367f25 commit 4f5afd1Copy full SHA for 4f5afd1
kernel.txt
@@ -87,7 +87,12 @@
87
88
38、top命令显示中S列代表什么?"I"表示什么状态?
89
90
-39、什么是内核抢占?在多核系统中怎么定义?
+39、什么是内核抢占?什么是用户态抢占?在多核系统中怎么定义?
91
+ (tips:内核抢占即运行在内核态的进程被抢占,与之对应的是用户态抢占,这两个抢占发生的时间点不一样,
92
+ 内核态抢占发生在从中断上下文回到内核态时,检查__preemp_count计数和need_resched标志,
93
+ 用户态抢占发生在从系统调用返回用户态,从中断上下文返回用户态时,检查need_resched标志。
94
+ CFS调度算法中,在每次时钟中断的处理中,会判断当前进程是否运行的时间足够多,
95
+ 或者是和下一个候选者的vruntime差距大于sched_wakeup_granularity_ns,那么就设置当前继承的need_resched标志位)
96
97
40、preempt_enable是一个抢占点吗?为什么?
98
(tips:在preemt_enable函数中,会尝试抢占执行,具体参考源码实现)
0 commit comments