Skip to main content
Power Canvas
Power should be turned off and on in real time, but CPU issues the command in non-real time (1/3)

December 23, 2024

In the previous column, I talked about power gating, which turns off power to the desired area to reduce power consumption. However, there is one more problem when performing power gating. The control system of the computer cannot be controlled in real time. This means that the power may not be turned off at the moment when it should be turned off.

Let me explain very, very briefly using a building analogy to explain what it means that the control system of the computer cannot be controlled in real time. If we look at the software system of the computer currently in use from the perspective of control, it consists of hardware, Operating System (O/S), and subsystem software.
1. Hardware can be likened to the frame and mechanical equipment of the building, such as the CPU, GPU, memory hard disk, keyboard, and mouse.
2. Operating System (O/S) can be likened to the manager who manages the building, such as electricity, water, and heating, such as Windows or Linux.
3. Subsystem software performs specific tasks, such as elevators and security systems in various facilities within the building. You can easily think of it as a printer driver.

The O/S is responsible for issuing commands, and the subsystem software is involved in most hardware operations.
As a result, the O/S often only issues commands, and the subsystem software often performs operations according to the O/S’s instructions.
You can think of the O/S as the brain, and the subsystem software as the autonomic nervous system. Just as the brain cannot control all organs, the O/S cannot control the system in every detail. That would be too much work and inefficient. So the O/S only makes decisions, and the subsystem software often handles the execution of decisions.

However, power management is also difficult to do this way. This is because, as I mentioned in the previous column, if the power to the subsystem software is turned off and the data disappears, the O/S must know all the data that has disappeared. If the brain tries to move the arm, but the autonomic nervous system cuts off the power to the arm, the brain cannot move the arm. Since our bodies always have data left, they will somehow move again, but if this happens to a computer, it will definitely malfunction.

Since the O/S has to make situational judgments or store data, power management itself cannot be done in real time.
Therefore, power management has traditionally been possible only at the O/S level.
The only thing that can manage the status of the entire system is the O/S. Android or Linux’s power management framework are representative examples.

However, the O/S is a typical non-real time software. The O/S is designed to process multiple tasks simultaneously. Therefore, since it tries to perform all tasks equally, it cannot always finish a specific task within a set time, and the power control that the user wants is real time.
Even if power gating is performed within 1 frame, it cannot be controlled by the O/S. This is because if the O/S control is delayed by even 1ms or even 1us, the frame on the display is broken, and people recognize this.
Power control itself can be performed within a few us, but in a structure where the O/S must intervene unconditionally, real-time power control is not possible.


이전 컬럼에서 얘기한 전력 소비를 줄이기 위해 원하는 부분에 power를 끄는 power gating에 대해 얘기했습니다.
그런데, power gating을 진행하는데 있어 한 가지 문제가 더 발생합니다.
컴퓨터의 제어 시스템이 실시간 제어가 불가능하다는 것입니다, 이 얘기는 power를 꺼야 하는 순간에 끄지 못할 수 있다는 것을 의미합니다.

컴퓨터의 제어 시스템이 실시간 제어가 불가능하다는 말이 어떤 말인지, 아주 아주 간략하게 건물에 비유해서 설명해보겠습니다.
현재 사용되는 컴퓨터의 소프트웨어 시스템을 제어 관점에서만 보면, 하드웨어, Operating System (O/S), sub system 소프트웨어로 구성이 되어 있습니다.
1. 하드웨어는 건물의 뼈대와 기계 설비로 비유가 가능한데, CPU, GPU, 메모리 하드디스크, 키보드, 마우스 등을 말합니다.
2. Operating System (O/S)는 Windows, Linux등으로 전기, 수도, 난방 등의 건물을 관리하는 관리자로 비유가 가능합니다.
3. sub system 소프트웨어는 건물 안의 다양한 시설인 엘리베이터, 보안 시스템 같이 특정 작업을 수행하는 것으로 쉽게 프린터 드라이버를 생각하시면 됩니다.

O/S는 명령을 내리는 역할을 하게 되고, sub system 소프트웨어는 대부분의 하드웨어 동작에 관여하게 됩니다.
그러다 보니, O/S는 명령만 내리고, sub system 소프트웨어는 O/S의 지시에 따라 수행만 하는 경우가 많습니다.
O/S를 뇌라고 생각하고, sub system 소프트웨어를 자율 신경 같은 거라고 생각하셔도 됩니다.
뇌가 모든 장기의 제어를 할 수 없듯이 O/S의 경우에도 시스템 제어를 일일이 할 수 가 없습니다. 그러기에는 일이 너무 많고 비효율적이죠. 그래서, O/S는 판단 정도만 하고, sub system software에서 판단에 대한 수행을 처리하는 일이 많죠.

하지만, power management는 이렇게 하기도 어렵습니다.
왜냐하면, 이전 칼럼에서 얘기한 것처럼 sub system software의 power를 꺼서 데이터가 사라지게 되면 O/S가 사라진 데이터까지 다 알고 있어야 하기 때문입니다. 뇌가 팔을 움직이려고 하는데, 자율 신경이 팔의 전원을 차단했다면, 뇌가 팔을 움직일 수 없겠죠. 우리 몸은 데이터라도 항상 남이 있으니까, 어떻게든 다시 움직이겠지만, 컴퓨터는 이런 상황이 발생하면 무조건 오동작입니다.

이렇게 O/S가 상황 판단을 하거나 데이터를 저장해줘야 하니까, Power management 자체가 real time으로 이뤄질 수가 없습니다.
그래서 전통적으로 power management는 O/S 레벨에서만 진행할 수 있었습니다.
전체 시스템의 상태를 관장할 수 있는 것은 O/S밖에 없죠.
Android나 Linux의 power management framework등이 대표적인 예이죠.

하지만, O/S는 대표적인 non-real time software입니다. O/S는 여러 작업을 동시에 처리할 수 있도록 설계되었습니다.  그래서 모든 작업을 골고루 진행하려고 하다 보니, 특정 작업을 항상 정확히 정해진 시간 안에 끝내지는 못하는데, 사용자가 원하는 power제어는 실시간 입니다.
1 frame내에서 power gating을 진행하고 싶어도, O/S가 제어해서는 제어를 진행할 수가 없습니다.
O/S제어가 1ms만 늦어도 아니 1us만 늦어도 display에서의 frame은 깨지고, 사람은 이를 인지하기 때문입니다.
power제어 자체는 수 us안에 이뤄질 수 있지만, 무조건 O/S가 끼어들어야 하는 구조에서는 실시간 power제어를 할 수가 없습니다.