gpt4 book ai didi

linux - 早期启动调度极其脆弱

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:58:20 25 4
gpt4 key购买 nike

根据 init/main.c: setup_kernel

    /* Disable preemption - early bootup scheduling is extremely
fragile until we cpu_idle for the first time*/
  1. 为什么叫脆弱?任何具体原因
  2. 它对cpu_idle的依赖是什么

最佳答案

内核中的抢占允许内核代码在完成之前被抢占。当时,虽然调度程序已经启动,但内核的许多部分尚未配置或设置,因此 start_kernel() 确保即使在启动定时器中断时也禁用抢占,从而确保重要的设置任务在完成之前不会被抢占。

一旦 cpu_idle 任务运行,如果我正确阅读源代码,所有必要的早期初始化任务都已完成,并且可以重新启用抢占。

关于linux - 早期启动调度极其脆弱,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23423608/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com