CPU

  • CPU Scheduling Policies 调度算法

    这篇文章系统梳理了操作系统中常见的 CPU 调度算法及其取舍。正文先介绍 turnaround time 和 response time 两个核心衡量指标,再依次讨论 FIFO、Shortest Job First、STCF、Round Robin、MLFQ、Lottery Scheduling 和 Stride Scheduling 的基本思路、优缺点与适用场景,随后重点展开 Linux Completely Fair Scheduler 的 vruntime、sched_latency、min_granularity、nice/weight 和红黑树实现方式,最后补充了多处理器环境下 single-queue 与 multi-queue 调度在负载均衡、锁竞争和 cache affinity 上的差异。

    2021年4月25日
    2.7K0