linux-kernel - Linux 内核(Samsung Exynos5422)中如何实现异构多处理(HMP)调度?

标签 linux-kernel scheduling smp odroid hmp

有人知道 Linux 内核调度程序中如何实现异构多处理(HMP)调度吗?

这已在 ODROID-XU3 板附带的内核中实现。 (https://github.com/hardkernel/linux.git -b odroidxu3-3.10.y-android)

我大致知道它会计算某个进程的负载,并根据该负载重新调度到更快或更慢的 CPU。 我正在寻找更详细的解释,如果可能的话,还有实现此功能的函数的代码位置。

最佳答案

代码:

主要在 kernel/sched/core.c 内查看#ifdef CONFIG_SCHED_HMP下的源代码

<小时/>

(并非如此)简要概述:

big.LITTLE CPU 可以配置为 2 种操作模式:

  • IKS在内核切换器中(也称为CPU 迁移)
  • GTS - 全局任务调度(也称为big.LITTLE MP)

GTS 是异构操作形式,即 HMP

在最抽象的层面上,HMP 目前仅通过扩展 DVFSSMP 负载平衡来支持。两者都充分意识到大核(相对于小核)的性能优势,并相应地调度高优先级、CPU 密集型前台任务。

Dynamic voltage and frequency scaling (DVFS) is used to adapt to instantaneous changes in required performance. The migration modes of big.LITTLE extends this concept by enabling a transition to "big" CPU cores above the highest DVFS operating point of the LITTLE cores. The migration takes about 30 microseconds. By contrast, the DVFS driver evaluates the performance of the OS and the individual cores typically every 50 milliseconds, although some implementations sample slightly more frequently. It takes about 100 microseconds to change voltage and frequency. Because the time taken to migrate a CPU or a cluster is shorter than the DVFS change time and an order of magnitude shorter than the OS evaluation period for DVFS changes, big.LITTLE transitions will enable the processors to run at lower operating points, more frequently, and further, be completely invisible to the user.

DVFS extended to handle big.LITTLE cores

In the Global Task Scheduling model, the DVFS mechanisms are still in operation, but the operating system kernel scheduler is aware of the big and LITTLE cores in the system and seeks to load balance high performance threads to high performance cores, and low performance or memory bound threads to the high efficiency cores. This is similar to SMP load balancers today, that automatically balance threads across the cores available in the system, and idle unused cores. In big.LITTLE Global Task Scheduling, the same mechanism is in operation, but the OS keeps track of the load history of each thread and uses that history plus real-time performance sampling to balance threads appropriately among big and LITTLE cores.

引用:community.arm.com : Ten Things to Know About big.LITTLE

关于linux-kernel - Linux 内核(Samsung Exynos5422)中如何实现异构多处理(HMP)调度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25498215/

相关文章:

linux - 修改menuconfig中的内核版本信息

根据条件选择 OpenMP pragma

c# - 如何使用 .NET 框架设置作业调度?

multithreading - 在 Linux SMP 上 boost 线程和不存在的 boost

c - 错误编译内核模块 linux/module.h : No such file or directory found

android - 支持 OTG 的 Android 设备中的 USB 主机模式

Linux:键码为 255 的按键事件的来源是什么?

algorithm - 家务调度算法

c - 了解最新(3.0.0 及更高版本)Linux 内核中 CONFIG_SMP、自旋锁和 CONFIG_PREEMPT 之间的链接

multithreading - 多核系统 UMA NUMA 的进程地址空间