是什么负责改变多核处理器中的内核负载和频率 [英] What is responsible for changing core's load and frequency in multicore processor

查看:109
本文介绍了是什么负责改变多核处理器中的内核负载和频率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一直在寻找多核设计的描述,我一直在寻找几个图表,但是所有这些看起来都像这样:

通过查看i7z命令输出,我知道不同的内核可以以不同的频率运行.

这表明,将由操作系统或内核本身的控制块来决定要为哪个内核提供新的过程以及更改内核本身的频率.

我的问题是:是什么控制每个核心的频率?是将READY进程与放置在操作系统上的特定核心相关联的工作,还是由处理器内的某些事情完成.

解决方案

将进程/线程调度到内核完全是架构状态的内核代码完成的. /a>到内存,然后新内核上的OS代码恢复保存的状态并恢复用户空间执行.

传统上,频率和电压缩放比例决定是由操作系统决定的.以Linux为例:决策代码称为州长(还有 arch Wiki链接在Google上排名很高).它看起来像进程多久在其上使用整个时间片的频率一样当前的核心.如果调控器决定CPU应该以不同的速度运行,则它将对一些控制寄存器进行编程以实现更改.据我了解,硬件负责选择正确的电压以支持请求的频率. /p>

据我了解,运行在每个内核上的操作系统都是独立做出决策的.在允许每个内核以不同频率运行的硬件上,决策代码不需要相互协调.如果在一个内核上运行高频信号需要整个芯片范围内的高压,则硬件可以解决这一问题.我认为DVFS(动态电压和频率缩放)的现代实现是相当高级的,OS只是告诉硬件它需要N个选择中的哪个,而板载功率微控制器则负责对振荡器/时钟分频器进行编程的细节.和稳压器.

英特尔的"Turbo"功能可将频率适时地提高到最大可持续频率之上,并在硬件中做出决策.只要操作系统要求最高的公布频率,当电源和散热允许时,CPU就会使用Turbo.

英特尔的Skylake进一步迈出了一步:操作系统可以将对DVFS的完全控制权移交给硬件,并有选择地加以限制.这样一来,它就可以从微秒到微秒做出反应,而不是在毫秒级的时间范围内做出反应.实际上,这确实可以在突发性工作负载中提供更好的性能,因为在有用时,更多的功率预算可用于Turbo.某些基准测试非常容易察觉,例如某些浏览器/JavaScript的IIRC.

在IDF2015上有关于Skylake的新电源管理的完整讨论此处,谢谢!链接至 Agner Fog的博客)

Having looked for a description of the multicore design i keep finding several diagrams, but all of them look somewhat like this:

I know from looking at i7z command output that different cores can run at different frequencies.

This would suggest that the decisions regarding which core will be given a new process and for changing the frequency of the core itself are done either by the operating system or by the control block of the core itself.

My question is: What controls the frequencies of each individual core? Is the job of associating a READY process with the specific core placed upon the operating system or is it done by something within the processor.

解决方案

Scheduling processes/threads to cores is purely up to the OS. The hardware has no understanding of tasks waiting to run. Maintaining the OS's list of processes that are runnable vs. waiting for I/O is completely a software thing.

Migrating a thread from one core to another is done by kernel code on the original core storing the architectural state to memory, then OS code on the new core restoring that saved state and resuming user-space execution.

Traditionally, frequency and voltage scaling decisions are made by the OS. Take Linux as an example: The decision-making code is called a governor (and also this arch wiki link came up high on google). It looks at things like how often processes have used their entire time slice on the current core. If the governor decides the CPU should run at a different speed, it programs some control registers to implement the change. As I understand it, the hardware takes care of choosing the right voltage to support the requested frequency.

As I understand it, the OS running on each core makes decisions independently. On hardware that allows each core to run at different frequencies, the decision-making code doesn't need to coordinate with each other. If running a high frequency on one core requires a high voltage chip-wide, the hardware takes care of that. I think the modern implementation of DVFS (dynamic voltage and frequency scaling) is fairly high-level, with the OS just telling the hardware which of N choices it wants, and the onboard power microcontroller taking care of the details of programming oscillators / clock dividers and voltage regulators.

Intel's "Turbo" feature, which opportunistically boosts the frequency above the max sustainable frequency, does the decision making in hardware. Any time the OS requests the highest advertised frequency, the CPU uses turbo when power and cooling allow.

Intel's Skylake takes this a step further: The OS can hand full control over DVFS to the hardware, optionally with constraints. That lets it react from microsecond to microsecond, rather than on a timescale of milliseconds. This does actually allow better performance in bursty workloads, because more power budget is available for turbo when it's useful. A few benchmarks are bursty enough to observe this, like some browser / javascript ones IIRC.

There was a whole talk about Skylake's new power management at IDF2015, check out the slides and/or archived webcast. The old method is described in a lot of detail there, too, to illustrate the difference, so you should really check it out if you want more detail than my summary. (The list of other IDF talks is here, thanks to Agner Fog's blog for the link)

这篇关于是什么负责改变多核处理器中的内核负载和频率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆