Show Table of Contents
3.2. cpu
cpu 子系統會排程 CPU,以存取控制群組。存取 CPU 資源會根據以下參數來排程,每個參數都位於控制群組虛擬檔案系統的獨立 pseudofile(偽檔案)裡:
- cpu.shares
- 這整數值表示控制群組裡,任務可以使用的相對 CPU 時間。舉例來說,在兩個控制群組中的任務之
cpu.shares都設為1的話,這兩個任務會收到均等的 CPU 時間;但其中一個任務的cpu.shares設為2的話,那它收到的 CPU 時間會是cpu.shares設為1的兩倍。 - cpu.rt_runtime_us
- 這表示一段時間,單位為微秒(microsecond,簡寫為 µs,在此以「us」表示),這是控制群組中的任務存取 CPU 資源的最長連續時間。建立這個限制可以防止控制群組中的任務獨占 CPU 時間。如果控制群組中的任務要每五秒存取 CPU 資源四秒,請將
cpu.rt_runtime_us設為4000000,並把cpu.rt_period_us設為5000000。 - cpu.rt_period_us
- 這表示一段時間,單位為微秒(microsecond,簡寫為 µs,在此以「us」表示),這是控制群組存取 CPU 資源所該分配的頻率。如果控制群組中的任務要每五秒存取 CPU 資源四秒,請將
cpu.rt_runtime_us設為4000000,並把cpu.rt_period_us設為5000000。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.