[转帖]What is Pstate

what,is,pstate · 浏览次数 : 0

小编点评

Sure, here is a summary of the content: * A P-state is a combination of frequency and voltage operating point for a CPU. * The frequency and voltage of a P-state are both scaled as the P-state increases. * Reducing frequency halves the runtime of an application, while increasing the voltage will increase the runtime. * P-states are used to reduce peak thermal load and save energy. * There are two primary reasons for P-states: reducing peak thermal load and saving energy.

正文

https://www.jianshu.com/p/342480d917e3

 

When someone refers to a P-state, generally only the frequency is talked about. For example, on my Intel® Core™ processor, P0 is 2.3 GHz, and P1 is 980 MHz. In truth, a P-state is both a frequency and voltage operating point. Both are scaled as the P-state increases.

The effect of reducing frequency

It's obvious that performance is directly related to frequency. We all know that increasing the frequency, increases a processor's performance. The same applies for decreasing the frequency. If you halve the frequency, a compute bound task runs half as fast. For example, if your task is compute bound, requiring 100 % of the CPU for 1 second at 2 GHz, it will take 2 seconds to execute at 1 GHz. (This is roughly correct. There are a host of other factors influencing runtime, such as cache size and speed, interrupts, etc.)

Now wait a moment. If we reduce the frequency, increasing the runtime of an application, how does this increase battery life? If we are decreasing the frequency, we are increasing the CPU utilization and reducing the % idle time. See the frequency half of Figure A below. This shouldn't have any effect on the power usage of the processor. It's running all that time anyway.

You're right, historically. This was the case years ago with those ancient generations old processors. Though I don't know this for a fact, I suspect that in some cases, decreasing the percent idle time might have increased energy usage since increased processor activity increases instantaneous power, and we're decreasing the % idle time (i.e. time of low activity). This is where voltage scaling comes into play. There are two primary reasons for P-states, one is to reduce the peak thermal load, and the other is to save power.

Reducing peak thermal load

The reasons why you want to reduce the peak thermal load is pretty obvious. The instantaneous energy usage (power) of the processor is related to its activity. If the processor is very busy, requiring a lot of gates to do a lot of switching, it runs hotter. So reducing the frequency reduces the peak thermal output even if the total energy usage is not reduced. The advantage of reducing peak thermal load has to do with cost. The effectiveness of your cooling is based upon peak power, not average power. (I'm neglecting the effect of thermal inertia.) So if you can reduce peak power, you reduce the cost and size of the equipment having to do the cooling. 

P-state 在Intel平台上通常指的是EIST

P-state是CPU频率和操作点电压的结合;

处理器性能和主频是直接相关的。增加主频可以增加处理器性。反之,即哪个低主频则降低性能。如果将主频减半,计算任务就会降低一半速度。不过,如果降低主频,但是增加CPU使用率并且降低idle时间百分比,则会影响电池使用时间。

引入P-state的两个主要原因是:降低尖峰时热能负载,以及降低能耗。

Linux下的pstate

注:Linux下的pstate是一个driver,指的是intel_pstate。

Intel_pstate driver

• 调节器(Governors)反映了用户策略决定:

§ intel_pstate只支持powersave和performance策略,其他驱动支持更多策略。

§ intel_pstate是一个调节器,并且hw驱动是一个整体,所以传统上这个governor是和hw驱动隔离的。

• intel_pstate "performance" 策略总是选择最高的p-state

§ 完全不考虑节能

• intel_pstate "powersave" 策略尝试平衡性能和节能

intel_pstate驱动监视使用率并能够决定何时增加或减少p-state。这个方式和其他governors类似。

服务器的频率以及p-state划分

 

 

CPU有一个标称频率(BASE Frequency),即在普通状态下,BIOS关闭Turbo开关的话,CPU的最高频率;即P1;

P0 - P1 是 turbo频率;P0是Turbo的最高频率,不保证;

P1 - Pn 是 保证范围(操作系统可见的状态)

Pn - LFM 是 温度控制范围

 

 

与[转帖]What is Pstate相似的内容:

[转帖]What is Pstate

https://www.jianshu.com/p/342480d917e3 When someone refers to a P-state, generally only the frequency is talked about. For example, on my Intel® Core™

[转帖]WHAT IS MTR?

https://github.com/traviscross/mtr mtr combines the functionality of the 'traceroute' and 'ping' programs in a single network diagnostic tool. As mtr

[转帖]什么是 istio

https://cizixs.com/2018/08/26/what-is-istio/ 如果你比较关注新兴技术的话,那么很可能在不同的地方听说过 istio,并且知道它和 service mesh 有着牵扯。这篇文章是我之前在公司内部做过的分享,可以作为了解 istio 的入门介绍,了解什么是 i

[转帖]什么是 LLVM?Swift, Rust, Clang 等语言背后的支持

https://www.oschina.net/translate/what-is-llvm-the-power-behind-swift-rust-clang-and-more?print 要了解用于以编程方式生成机器原生代码的编译器框架是如何让新语言的推出以及对现有的语言进行增强比以往更加容易了

[转帖]可观测|流量|日志|监控|链路|用户体验

https://cloud.tencent.com/developer/article/2019401?areaSource=105001.8&traceId=ySuPzDMCMO5dVSJSYsUT9 What is observability? In IT and cloud computing

[转帖]gooyfs 的编译 github

https://github.com/kahing/goofys/issues/527 @maobaolong @PengleiShi I had the same issue as you guys, new to git and had to work it out. Here is what

[转帖]Unix is dead. Long live Unix!

https://www.theregister.com/2023/01/17/unix_is_dead/ Don't expect to see any more big AIX news. What does that leave us with? Liam Proven Tue 17 Jan 2

【转帖】What are segfault rip/rsp numbers and how to use them

https://stackoverflow.com/questions/1456899/what-are-segfault-rip-rsp-numbers-and-how-to-use-them 11 When my linux application crashes, it produces a

[转帖]每个程序员都应该了解的内存知识【第一部分】

https://www.oschina.net/translate/what-every-programmer-should-know-about-memory-part1?print [编辑的话: Ulrich Drepper最近问我们,是不是有兴趣发表一篇他写的内存方面的长文。我们不用看太多就已

[转帖]Diagnosing latency issues

Finding the causes of slow responses This document will help you understand what the problem could be if you are experiencing latency problems with Re