mirror of
https://github.com/gatieme/LDD-LinuxDeviceDrivers.git
synced 2026-08-18 17:17:39 +08:00
distro/openanolis: cpuacct stat
This commit is contained in:
+86
-13
@@ -2,14 +2,9 @@
|
||||
=====================
|
||||
|
||||
|
||||
[Alibaba Cloud Linux 2](https://help.aliyun.com/document_detail/154950.html)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[Alibaba Cloud Linux 2功能和接口概述](https://help.aliyun.com/document_detail/177687.html)
|
||||
- [x] [Alibaba Cloud Linux 2](https://help.aliyun.com/document_detail/154950.html)
|
||||
- [x] [Alibaba Cloud Linux 2功能和接口概述](https://help.aliyun.com/document_detail/177687.html)
|
||||
|
||||
|
||||
如果您对Linux的内核系统有一定的了解,并且有需求需要使用Linux内核功能,您可以依据下表提供的Alibaba Cloud Linux 2的内核功能与接口进行相关操作.
|
||||
@@ -37,19 +32,54 @@
|
||||
|
||||
|
||||
```cpp
|
||||
abd7f977069d alinux: sched: Fix a branch prediction error in static_key
|
||||
a66f5804aa67 alinux: sched: Fix compiling error without CONFIG_FAIR_GROUP_SCHED
|
||||
252315eb68be alinux: sched: get_sched_lat_count_idx optimization
|
||||
b2250b442fa9 alinux: sched: Fix per-cgroup idle accounting deadlock
|
||||
git log --oneline | grep alinux | grep -E "sched|cpuacct"
|
||||
```
|
||||
|
||||
```cpp
|
||||
06d7286d7c8e alinux: sched: add kconfig SCHED_SLI
|
||||
```
|
||||
|
||||
## 1.1 Latency Histograms
|
||||
-------
|
||||
|
||||
```cpp
|
||||
echo 1 > /proc/cpusli/sched_lat_enabled
|
||||
|
||||
mount -t tmpfs cgroup_root /sys/fs/cgroup
|
||||
mkdir -p /sys/fs/cgroup/cpu,cpuacct
|
||||
mount -t cgroup -o cpu,cpuacct cpu,cpuacct /sys/fs/cgroup/cpu,cpuacct
|
||||
```
|
||||
|
||||
cpuacct 中引入了一些调度相关的 latency 的统计信息, 并用 histograms 的方式输出.
|
||||
|
||||
| 接口 | 描述 | 实现思路 | commit |
|
||||
|:---:|:----:|:-------:|:-------:|
|
||||
| cpuacct.wait_latency | 在就绪队列里的等待时间 | 统计方式同 wait_sum/wait_start 等计数器. enqueue_entity 入队时开始计时, 出队时结束计时(set_next_entity 准备投入运行时, 也会出队.)| [alinux: sched: Introduce cfs scheduling latency histograms](https://github.com/alibaba/cloud-kernel/commit/76d98609f83244bdc5f3484945a47cc43d509f64) |
|
||||
| cpuacct.cgroup_wait_latency | 在就绪队列里的等待时间 | 统计方式同 wait_sum/wait_start 等计数器. enqueue_entity 入队时开始计时, 出队时结束计时(set_next_entity 准备投入运行时, 也会出队.)| [alinux: sched: Add cgroup's scheduling latency histograms](https://github.com/alibaba/cloud-kernel/commit/6dbaddaa480a315f1fd5d66d16c0b3a0c3dd25ea) |
|
||||
| cpuacct.block_latency/cpuacct.ioblock_latency | 统计进程 D 状态阻塞的时间(其中 ioblock_latency 统计因为 I/O 阻塞的等待时间) | 更新方式 block_latency 同 block_start, ioblock_latency 同 iowait_sum.<br>进程出队 update_stats_dequeue 开始计时, 进程入队的时候 update_stats_enqueue_sleeper 停止计时 |[alinux: sched: Add cgroup-level blocked time histograms](https://github.com/alibaba/cloud-kernel/commit/a055ee2ce27b61864adf67fe2ffc426b89913b89) |
|
||||
|
||||
|
||||
```cpp
|
||||
ab81d2d9f745 alinux: sched: Add cpu_stress to show system-wide task waiting
|
||||
c7462cfec178 alinux: sched: Fix wrong cpuacct_update_latency declaration
|
||||
fa418988c52e alinux: sched: Finer grain of sched latency
|
||||
|
||||
2abfd07b1c1a alinux: sched: Add "nr" to sched latency histogram
|
||||
6dbaddaa480a alinux: sched: Add cgroup's scheduling latency histograms
|
||||
a055ee2ce27b alinux: sched: Add cgroup-level blocked time histograms
|
||||
76d98609f832 alinux: sched: Introduce cfs scheduling latency histograms
|
||||
bcaf8afd6270 alinux: sched: Add switch for scheduler_tick load tracking
|
||||
bb48b716f496 alinux: sched: Add switch for update_blocked_averages
|
||||
```
|
||||
|
||||
## 1.2 CPUACCT STAT
|
||||
-------
|
||||
|
||||
cpuacct 中引入的 proc_stat 统计了 CGROUP 分组中进程的 CPU 占用/空闲等统计信息
|
||||
|
||||
| 接口 | 描述 | 实现思路 | commit |
|
||||
|:---:|:----:|:-------:|:-------:|
|
||||
| cpuacct.proc_stat | cpuacct 的详细统计信息 | NA | [commit 9be0ac2bcbaa ("alinux: cpuacct: export cpuacct.proc_stat interface")](https://github.com/alibaba/cloud-kernel/commit/9be0ac2bcbaa1831196a88f5e81ea162811f3418) |
|
||||
|
||||
```cpp
|
||||
1c5ab7a7f5d9 alinux: sched: Fix %steal in cpuacct.proc_stat in guest OS
|
||||
1607a4855848 alinux: sched: Fix regression caused by nr_uninterruptible
|
||||
1e0cec0b58c7 alinux: sched: make SCHED_SLI dependent on FAIR_GROUP_SCHED
|
||||
@@ -58,7 +88,50 @@ bb48b716f496 alinux: sched: Add switch for update_blocked_averages
|
||||
9e7b35d6d84e alinux: sched: Introduce per-cgroup iowait accounting
|
||||
c75529800bf2 alinux: sched: Introduce per-cgroup steal accounting
|
||||
61e5885959be alinux: sched: Introduce per-cgroup idle accounting
|
||||
965d75d3785c alinux: cpuacct: make cpuacct record nr_migrations
|
||||
9410d3142882 alinux: cpuacct: Export nr_running & nr_uninterruptible
|
||||
004b3ba9ebd3 alinux: sched/cputime: Fix guest cputime of cpuacct.proc_stat
|
||||
8ab45c97b581 alinux: cpuacct/proc_stat: Consider isolcpus
|
||||
9be0ac2bcbaa alinux: cpuacct: export cpuacct.proc_stat interface
|
||||
36da4fe9851a alinux: sched: Maintain "nr_uninterruptible" in runqueue
|
||||
06d7286d7c8e alinux: sched: add kconfig SCHED_SLI
|
||||
```
|
||||
|
||||
|
||||
## 1.3 PSI V1
|
||||
-------
|
||||
|
||||
```cpp
|
||||
1bd8a72b1181 alinux: psi: using cpuacct_cgrp_id under CONFIG_CGROUP_CPUACCT
|
||||
1f49a7385032 alinux: psi: Support PSI under cgroup v1
|
||||
dc159a61c043 alinux: introduce psi_v1 boot parameter
|
||||
```
|
||||
|
||||
# 2 Scheduler
|
||||
-------
|
||||
|
||||
|
||||
## 2.1
|
||||
|
||||
```cpp
|
||||
bcaf8afd6270 alinux: sched: Add switch for scheduler_tick load tracking
|
||||
bb48b716f496 alinux: sched: Add switch for update_blocked_averages
|
||||
d2440c99979d alinux: sched/fair: use static load in wake_affine_weight
|
||||
```
|
||||
|
||||
## 2.2 burst 等
|
||||
-------
|
||||
|
||||
|
||||
```cpp
|
||||
db83ac46e3f5 alinux: cpuacct: Export nr_running & nr_uninterruptible
|
||||
982358c4f1f0 alinux: sched: Maintain "nr_uninterruptible" in runqueue
|
||||
3a022fb07707 alinux: sched/fair: Fix CPU burst stat
|
||||
a97cbf90404c alinux: sched/fair: Introduce init buffer into CFS burst
|
||||
95527c5751fa alinux: sched: Restore upper limit of cfs_b->buffer to max_cfs_runtime
|
||||
a0b0376bdbdc alinux: sched: Add document for burstable CFS bandwidth control
|
||||
744d0dc11559 alinux: sched: Add cfs bandwidth burst statistics
|
||||
739156b53e75 alinux: sched: Make CFS bandwidth controller burstable
|
||||
d9ba6d0880e3 alinux: sched: Introduce primitives for CFS bandwidth burst
|
||||
9d168f216486 alinux: sched: Defend cfs and rt bandwidth against overflow
|
||||
```
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Reference in New Issue
Block a user