gpt4 book ai didi

linux - Linux 中的任务调度器和 CPU 隔离

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

我是一个内核新手,包括调度程序。我知道有一个 IO 调度程序和一个任务调度程序,根据这个 post IO 调度程序使用最终由任务调度处理的正常任务。

  1. So if I run an user space thread that was assigned to an isolated core (using isolcpus) and it will do some IO operation, will the the task created by the IO scheduler get executed on the isolated core ?
  2. Since CFS seems to favor user interaction does this mean that CPU intensive threads might get a lower CPU time in the long run? Isolating cores can help mitigate this issue?
  3. Isolating cores can decrease the scheduling latency (the time it takes for a thread that was marked as runnable to get executed ) for the threads that are pined to the isolated cores?

最佳答案

So if I run an user space thread that was assigned to an isolated core (using isolcpus) and it will do some IO operation, will the the task created by the IO scheduler get executed on the isolated core ?

isolcpus 正在做的是将特定核心从 cpu 的内核列表中取出,以便它可以安排任务。因此,一旦您将一个 cpu 从内核的 cpus 列表中分离出来,它就永远不会在该核心上安排任何任务,无论该核心是空闲的还是正在被其他进程/线程使用。

Since CFS seems to favor user interaction does this mean that CPU intensive threads might get a lower CPU time in the long run? Isolating cores can help mitigate this issue?

在我看来,隔离 CPU 有完全不同的用途。基本上,如果您的应用程序同时具有快速线程(没有系统调用的线程,并且对延迟敏感)和慢速线程(具有系统调用的线程),您可能希望为您的快速线程配备专用的 cpu 内核,这样它们就不会被内核的调度中断过程,因此可以在没有任何噪音的情况下运行到完成。快速线程通常对延迟敏感。另一方面,慢速线程或对延迟不敏感且正在为您的应用程序提供支持逻辑的线程不需要专用的 cpu 内核。如前所述,隔离 cpu 服务器有不同的目的。我们一直在我们的组织中做这一切。

Isolating cores can decrease the scheduling latency (the time it takes for a thread that was marked as runnable to get executed ) for the threads that are pined to the isolated cores?

由于您是从内核的 cpus 列表中获取 cpus,这肯定会影响其他线程和进程,但是您又需要额外考虑和注意真正对延迟敏感的代码,并且您希望将它与您的非延迟敏感代码。

希望对您有所帮助。

关于linux - Linux 中的任务调度器和 CPU 隔离,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54421495/

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