0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Linux 5.7 Thermal Pressure⁠のcommitを確認

Posted at

Linux 5.7におけるおもなアップデートは以下の通り。
CPUがオーバーヒートしたときに,ガバナーによる周波数の変更でパフォーマンスが下がりすぎないよう,タスクスケジューラが調整を行う「サーマルプレッシャー(Thermal Pressure⁠)⁠」の実装

これを実装ベースで確認してみよう!


修正されたソースコードの位置は、スケジュール関係なので、ここ。


コミットログを見ると、このあたり。

sched/pelt: Add support to track thermal pressure

Extrapolating on the existing framework to track rt/dl utilization using pelt signals, add a similar mechanism to track thermal pressure.

既存のFrameworkに外挿し、pelt signalを利用してrt/dl 使用率をtrackingし、thermal pressureをtrackingする同様のメカニズムを追加します。

The difference here from rt/dl utilization tracking is that, instead of tracking time spent by a CPU running a RT/DL task through util_avg, the average thermal pressure is tracked through load_avg.

rt/dl 使用率trackingとの違いは、util_avgを介してRT/DL taskを動かしているCPUの時間経過時間をtrackingする代わりに、load_avgを介して平均thermal pressureをtrackingする事である。

This is because thermal pressure signal is weighted time "delta" capacity unlike util_avg which is binary.

これは、binaryであるutil_avgと違って、thermal pressure signal は重み付時間の"delta" capacityであるためです。

"delta capacity" here means delta between the actual capacity of a CPU and the decreased capacity a CPU due to a thermal event.

ここでいう"delta capacity"とは、CPUの実際のcapacityに対して、thermal eventによってCPUが減少したcapacityの差分を意味します。
.

In order to track average thermal pressure, a new sched_avg variable avg_thermal is introduced. Function update_thermal_load_avg can be called to do the periodic bookkeeping (accumulate, decay and average) of the thermal pressure.

平均thermal pressureを言い換えると、新しいsched_avg変数であるavg_thermalの導入になります。関数 update_thermal_load_avgは、定期的なbookkeeping(累積・減衰・平均化)を実行するために、呼び出されます。

sched/fair: Enable periodic update of average thermal pressure

Introduce support in scheduler periodic tick and other CFS bookkeeping APIs to trigger the process of computing average thermal pressure for a CPU.

scheduler内に、定期的なtickと他のCFS bookkeeping APIで、CPUの平均thermal pressureの計算処理のトリガーをサポートします。

Also consider avg_thermal.load_avg in others_have_blocked which allows for decay of pelt signals.

また、pelt signalで減衰された他のblockedの中で、他のothers_have_blockedのavg_thermal.load_avgを検討してください。

sched/fair: Update cpu_capacity to reflect thermal pressure

cpu_capacity initially reflects the maximum possible capacity of a CPU. Thermal pressure on a CPU means this maximum possible capacity is unavailable due to thermal events.

cpu_capacityは、CPUの最大許容されるcapacityを初期に反映させたものである。CPUのThermal Pressureは、thermal eventによって無効となった中で最大の可能なcapacityである。

This patch subtracts the average thermal pressure for a CPU from its maximum possible capacity so that cpu_capacity reflects the remaining maximum capacity.

このパッチは、cpu_capacityが残りの最大capacityを反映するように、可能な最大capacityからCPUの平均 thermal pressureを差し引きます。

sched/fair: Enable tuning of decay period

Thermal pressure follows pelt signals which means the decay period for thermal pressure is the default pelt decay period.

Thermal pressureは、pelt signalに従います。つまり、thermal pressureの減衰時期は、デフォルトのpelt 減衰期間になります。

Depending on SoC characteristics and thermal activity, it might be beneficial to decay thermal pressure slower, but still in-tune with the pelt signals.

SoCの特性と、theremal activityに応じて、theremal pressureをゆっくり減衰させることは有益ですが、しかし、pelt signalと一致します。

One way to achieve this is to provide a command line parameter to set a decay shift parameter to an integer between 0 and 10.

これを実現する1つの方法は、コマンドラインパラメーターを指定して、減衰シフトのパラメーターを0〜10の整数に設定することです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?