scheduler/cfs: Load Balancing

This commit is contained in:
Cheng Jian
2022-11-28 22:18:24 +08:00
parent 316664110b
commit c0b46f809d
13 changed files with 1580 additions and 57 deletions
+1 -1
View File
@@ -1957,7 +1957,7 @@ max_idle_balance_cost 则跟踪了当前调度域最近一段时间执行 idle b
| 时间 | 作者 | 特性 | 描述 | 是否合入主线 | 链接 |
|:----:|:----:|:---:|:---:|:----------:|:----:|
| 2013/09/13 | Jason Low <jason.low2@hp.com> | [sched: Limiting idle balance](https://lore.kernel.org/patchwork/patch/403138) | 这些补丁修改和添加了限制 idle balance 的方式. [第一个补丁](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=abfafa54db9aba404e8e6763503f04d35bd07138)减少了我们高估 avg_idle 的可能性. [第二个补丁](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9bd721c55c8a886b938a45198aab0ccb52f1f7fa)引入了 sd->max_idle_balance_cost 跟踪了跟踪每个调度域执行 idle balance 所花费的最大成本, 如果当前 CPU 的平均 idle 时间 rq->avg_idle 小于 sd->max_idle_balance_cost, 则限制 idle balance, 此时没必要再通过 idle balance 从其他 CPU 上 pull 一个进程过来, 因此可能 idle balance 还没有完成, 就本核上其他进程就可以已经唤醒准备投入运行. [第三个补丁](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f48627e686a69f5215cb0761e731edb3d9859dd9) 则周期性地衰减每个 sched_domain 的 max_idle_balance_cost. 当 CPU 保持空闲的时间很短且不超过执行平衡的成本时, 这些更改进一步减少了我们尝试 idle balance 的机会. | v5 ☑ 3.13-rc1 | [LORE v5,0/3](https://lore.kernel.org/all/1379096813-3032-1-git-send-email-jason.low2@hp.com) |
| 2013/09/13 | Jason Low <jason.low2@hp.com> | [sched: Limiting idle balance](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=f48627e686a69f5215cb0761e731edb3d9859dd9) | 这些补丁修改和添加了限制 idle balance 的方式. [第一个补丁](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=abfafa54db9aba404e8e6763503f04d35bd07138)减少了我们高估 avg_idle 的可能性. [第二个补丁](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9bd721c55c8a886b938a45198aab0ccb52f1f7fa)引入了 sd->max_idle_balance_cost 跟踪了跟踪每个调度域执行 idle balance 所花费的最大成本, 如果当前 CPU 的平均 idle 时间 rq->avg_idle 小于 sd->max_idle_balance_cost, 则限制 idle balance, 此时没必要再通过 idle balance 从其他 CPU 上 pull 一个进程过来, 因此可能 idle balance 还没有完成, 就本核上其他进程就可以已经唤醒准备投入运行. [第三个补丁](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f48627e686a69f5215cb0761e731edb3d9859dd9) 则周期性地衰减每个 sched_domain 的 max_idle_balance_cost. 当 CPU 保持空闲的时间很短且不超过执行平衡的成本时, 这些更改进一步减少了我们尝试 idle balance 的机会. | v5 ☑ 3.13-rc1 | [LORE v5,0/3](https://lore.kernel.org/all/1379096813-3032-1-git-send-email-jason.low2@hp.com) |
### 4.4.2 Improve cost accounting of newidle_balance
-------
@@ -1,21 +1,9 @@
ROOT=../../../
PLATFORM=$(shell $(ROOT)/systype.sh)
include $(ROOT)/Make.defines.$(PLATFORM)
target=memorylayout
target=load_balance.svg newidle_balance.svg nohz_idle_balance.svg tick_load_balance.svg passive_load_balance.svg
all:$(target)
memorylayout : memorylayout.o
$(CC) $^ -o $@ $(LDFLAGS)
echo "C程序的内存布局..."
%.o : %.c
$(CC) -c $^ -o $@ $(CFLAGS) $(DEFINES)
%.svg : %.gv
dot -Tsvg $^ -o $@
clean :
rm -rf *.o
rm -rf $(target)
@@ -2,8 +2,102 @@
-------
# 2 周期性调度器
* 主动 Load Balancing
1. CFS 负载均衡器周期性的检查系统的负载均衡状态, 然后从 busy CPU 上拉取任务出来, 使系统跟均衡.
2. 但是要想让系统中的 Newly Idle CPU, 能够躁动起来, 就需要借助 Idle Load Balance.
3. 而对于进入 NOHZ 状态的 IDLE CPU, 只能寄希望于 NOHZ Idle Load Balance 通过 KICK 将其唤醒.
| 均衡器 | 描述 |
|:----:|:----:|
| 周期性负载均衡 (periodic load balance 或者 tick load balance | 在 TICK 中, 周期性的检测系统的负载均衡状况, 依次遍历每层调度域, 自底向上进行负载均衡. 通过 find_busiest_group() 找到系统中负载最重的 sched_group, 通过 find_busiest_group() 找到其中最繁忙的 CPU, 将其上的 RUNNABLE(甚至是 RUNNING) 任务拉到本 CPU 以便让系统的负载处于均衡的状态. 为了避免每层调度域负载均衡过于频繁, 通常在 sched_group 内第一个 IDLE 的 CPU 上执行, 参见 should_we_balance(), 同时通过 sd->balance_interval 限制出发间隔. |
| New Idle Load Balance | 当 CPU 上没有任务执行即将进入 IDLE 状态的时候, 是执行 Load Balance 非常合适的时机. 这时候看看其他 CPU 是否需要帮忙, 从 BUSY 的 CPU 上拉取任务, 可以让整个系统的负载处于更加均衡的状态. |
| NOHZ Idle Load Balance | 其他的 CPU 已经进入 NOHZ IDLE 状态, 不太可能触发 TICK 进行周期性负载均衡, 但是本 CPU 上任务又太重, 此时则需要通过 IPI KICK 其他 IDLE 的 CPU, 唤醒它来进行负载均衡. |
* 被动 Load Balancing
4. 除了 CFS 本身 PULL 机制的主动 Load Balance 之外, 可以认为: 所有 select_task_rq 的时机都是一次隐含的 LoadBalance. 因此选核决策本身, 也需要考虑一定的负载均衡决策.
| 时机 | 描述 |
|:---:|:----:|
| WF_FORK | 每次 FORK 后, wake_up_new_task() 唤醒新创建的进程时, 会为进程选择一次 CPU. |
| WF_EXEC | 每次一个进程执行 exec 后, sched_exec() 中会为新进程重新选核. |
| WF_TTWU | 每次 try_to_wake_up() 唤醒进程时, 为重新为进程选核. |
# 2 SMP NICE 的 Load Balancing
-------
## 2.1 Periodic Load Balance
-------
| 背景 | 描述 | 参考 |
|:---:|:----:|:---:|
| 为什么需要 Periodic Load Balance | 周期性地检查系统的负载均衡情况, 必要时执行负载均衡. | trigger_load_balance() |
| 哪些 CPU 触发/执行 NOHZ Load Balance | 通常是 sched_group 域内第一个 IDLE CPU. 没有没有 IDLE CPU, 则由 sched_group 的第一个 CPU 来完成. | should_we_balance() |
| 如何触发 Periodic Load Balance | TICK 中通过发送 SCHED_SOFTIRQ 的软中断来处理, 最终执行 run_rebalance_domains(). | run_rebalance_domains() |
| 如何进行 Periodic Load Balance | 自底向上遍历所有调度域, 对所有配置了调度域, 依次执行 load_balance(). | rebalance_domain() |
![Periodic Load Balance](./tick_load_balance.svg)
## 2.2 New Idle Load Balance
-------
| 背景 | 描述 | 参考 |
|:---:|:----:|:---:|
| 为什么需要 New Idle Load Balance? | 为了保持系统吞吐量最大化, 那么当 CPU 即将 IDLE 时, 尝试从其他 BUSY CPU 上 PULL 任务出来时一个非常合适的主动 Load Balance 时机. 但是在每次 CPU NEWLY IDLE 时都进行 Idle Balancing 又时非常不合适的. 因此如果该 CPU 平均 IDLE 时间非常短, CPU 本身很快就会被任务重新唤醒, 这时当 CPU 重新回来执行的任务的时候, 还是 cache hot 的, 如果从其他 CPU 上拉取任务, 那么这些新的任务会破坏当前 CPU 上原来任务的 cache 状态. 更进一步此时被唤醒的任务不得不出现 RUNNABLE, 甚至迁移, 这都无疑会影响系统的性能. | NA |
| 哪些 CPU 触发/执行 NOHZ Load Balance | 没有任务执行, 即将进入 IDLE 状态的 CPU 作为 src_cpu. 系统中繁忙的 CPU 作为 dst_cpu. | newidle_balance() |
| 如何触发 New Idle Load Balance | 以下情况下 IDLE CPU 不会执行 Idle Balancing. 1. 如果 CPU 上有 ttwu_pending, 则其马上就会被唤醒.<br>2. 如果当前 IDLE CPU 的历史平均 IDLE 时间 avg_idle 比系统整体的 newidle 开销 max_newidle_lb_cost 要小, 说明做 Idle Balancing, 收益不大. 任务都还没有 PULL 过来, CPU 就被唤醒了已经.<br>3. root_domain 需要 overload, 如果 CPU 上大于 1 个 runnable task, 即该 CPU 上有等待执行的任务. 或者只有一个正在运行的任务, 但是是 misfit task. 则会对应设置 sched_group 为 SG_OVERLOAD, 继而 root_domain 被认为是 overload. | newidle_balance() |
| 如何进行 New Idle Load Balance | 从当前 newly IDLE 的 CPU, 自底向上遍历所有调度域, 对所有配置了 SD_BALANCE_NEWIDLE 的调度域, 依次执行 load_balance(). | newidle_balance() |
![New Idle Load Balance](./newidle_balance.svg)
## 2.3 NOHZ Load Balance
-------
| 背景 | 描述 | 参考 |
|:---:|:----:|:---:|
| 为什么需要 NOHZ Load Balance? | 如果 CPU 进入 IDLE 状态之后仍然有周期性的 TICK, 那么通过周期性负载均衡就能完成负载均衡了. 但是如果内核配置了 NOHZ, 那么 CPU 进入 IDLE 状态后, TICK 也会被停掉. 这就造成周期性负载均衡不会触发. 不需要 IPI 来唤醒 idle 的 CPU. 和周期性均衡一样, NOHZ idle load balance 也是通过 busy CPU 上 tick 驱动的, 如果需要 kick idle load balancer, 那么就会通过 GIC 发送一个 ipi 中断给选中的 idle CPU, 让它代表系统所有的 idle CPU 们进行负载均衡. | NA |
| 哪些 CPU 触发 NOHZ Load Balance | TICK 中触发周期性负载均衡之前, 检查是否需要进行 NOHZ KICK, 唤醒一个 IDLE CPU 来帮忙做 Load Balancing. | trigger_load_balance()<br>->nohz_balancer_kick()<br>->kick_ilb() |
| 如何触发 NOHZ Load Balance | BUSY 的 CPU 会 KICK ILB owner, 通过 IPI 发送 SCHED_SOFTIRQ. 并标记 ILB owner 的 rq->nohz_idle_balance. | nohz_csd_func()<br>->raise_softirq_irqoff(SCHED_SOFTIRQ) |
| 哪些 CPU 执行 NOHZ Load Balance | 会寻找一个 IDLE 的 CPU, 作为 ILB owner 来执行. 通常为 nohz.idle_cpus_mask 记录的第一个 IDLE CPU. | find_new_ilb() |
| 如何进行 NOHZ Load Balance | ILB owner 接收到 SCHED_SOFTIRQ 后, 触发 run_rebalance_domains() 时会检查是否需要进行 nohz_idle_balance(). | run_rebalance_domains()<br>->nohz_idle_balance(). |
![NOHZ Load Balance](./nohz_idle_balance.svg)
## 2.4 Load Balance 的核心主体
-------
![Load Balance](./load_balance.svg)
## 2.5 Passive Load Balancing
-------
| 均衡器 | 描述 | 选核 select_task_rq_fair() 标记的 FLAG | 执行均衡决策时的 FLAG |
|:-----:|:----:|:--------:|:--------:|
| FORK 均衡 | 创建任务时, 确定任务是在父任务运行的 CPU 上执行, 还是迁移到其他 CPU. | 如果可能, 请选择具有缓存亲和力的 CPU 或 IDLE CPU, 否则将迁移到 CPU 负载较低的 CPU 运行. 在 wake_up_new_task() 函数中使用 SD_BALANCE_FORK 标志调用它. | WF_FORK | SD_BALANCE_FORK |
| EXEC 平衡 | 进程执行 exec, 加载新程序空间, 运行新任务时, 确定任务是从现有 CPU 执行还是迁移到其他 CPU. 如果可能. 请选择具有缓存亲和力的 cpu 或 idle cpu,否则将迁移到 CPU 负载较低的 cpu 运行. 迁移到其他 cpu 时使用混合线程. 在 sched_exec() 函数中使用 SD_BALANCE_EXEC 标志. | WF_EXEC | SD_BALANCE_EXEC |
| WAKEUP 平衡 | 确定在 idle 任务唤醒时是从唤醒的 CPU 执行还是迁移到其他 IDLE CPU. 在 try_to_wake_up() 中使用 SD_BALANCE_WAKE 标志. | WF_TTWU | SD_BALANCE_WAKE |
![Passive Load Balancing](./passive_load_balance.svg)
# 3 能效感知的 Load Balancing 决策
-------
# X 扩展阅读
-------
# 3
| 文档 | 描述 |
|:---:|:----:|
| [内核工匠 - 负载均衡情景分析](https://blog.csdn.net/feelabclihu/article/details/112057633) | 介绍 CFS 负载均衡的基础框架核原理. |
| [jakeisname 的博客专栏](http://jake.dothome.co.kr/scheduler) | 韩国内核开发者 jakeisname 的博客专栏. |
@@ -10,14 +10,42 @@ digraph load_balance {
newidle_balance -> load_balance;
// 负载均衡核心逻辑
load_balance:s -> {should_we_balance, find_busiest_group, find_busiest_queue, detach_tasks, attach_tasks, need_active_balance, stop_one_cpu_nowait};
should_we_balance -> {group_balance_mask, group_balance_cpu};
find_busiest_group -> {init_sd_lb_stats, update_sd_lb_stats, sched_energy_enabled, compare_local_busiest_group_type, calculate_imbalance};
find_busiest_queue -> for_each_sched_group_span -> {fbq_classify_rq, switch_env_migration_type_FBQ};
detach_tasks -> {can_migrate_task, switch_env_migration_type_DT, detach_task};
attach_tasks -> {attach_task};
need_active_balance -> stop_one_cpu_nowait -> active_load_balance_cpu_stop [style=dashed];
active_load_balance_cpu_stop -> {detach_one_task, attach_one_task};
subgraph cluster_0 {
label = "执行 Load Balance";
color = blue;
load_balance:s -> {should_we_balance, find_busiest_group, find_busiest_queue, detach_tasks, attach_tasks, need_active_balance, stop_one_cpu_nowait};
subgraph cluster_1 {
label = "寻找 dst CPU";
color = red;
should_we_balance -> {group_balance_mask, group_balance_cpu};
};
subgraph cluster_2 {
label = "寻找 src CPU";
color = red;
find_busiest_group -> {init_sd_lb_stats, update_sd_lb_stats, sched_energy_enabled, compare_local_busiest_group_type, calculate_imbalance};
find_busiest_queue -> for_each_sched_group_span -> {fbq_classify_rq, switch_env_migration_type_FBQ};
};
subgraph cluster_3 {
label = "Normal Migration";
color = red;
detach_tasks -> {can_migrate_task, switch_env_migration_type_DT, detach_task};
attach_tasks -> {attach_task};
};
subgraph cluster_4 {
label = "Active Migration";
color = red;
need_active_balance -> stop_one_cpu_nowait -> active_load_balance_cpu_stop [style=dashed];
active_load_balance_cpu_stop -> {detach_one_task, attach_one_task};
};
};
rebalance_domains [label="rebalance_domains"; style=filled; fillcolor=palegreen; shape=oval];
newidle_balance [label="newidle_balance"; style=filled; fillcolor=palegreen; shape=oval];
@@ -0,0 +1,362 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.43.0 (0)
-->
<!-- Title: load_balance Pages: 1 -->
<svg width="3234pt" height="434pt"
viewBox="0.00 0.00 3234.00 434.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 430)">
<title>load_balance</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-430 3230,-430 3230,4 -4,4"/>
<g id="clust1" class="cluster">
<title>cluster_0</title>
<polygon fill="none" stroke="blue" points="8,-8 8,-382 3218,-382 3218,-8 8,-8"/>
<text text-anchor="middle" x="1613" y="-366.8" font-family="Times,serif" font-size="14.00">执行 Load Balance</text>
</g>
<g id="clust3" class="cluster">
<title>cluster_1</title>
<polygon fill="none" stroke="red" points="16,-160 16,-307 461,-307 461,-160 16,-160"/>
<text text-anchor="middle" x="238.5" y="-291.8" font-family="Times,serif" font-size="14.00">寻找 dst CPU</text>
</g>
<g id="clust5" class="cluster">
<title>cluster_2</title>
<polygon fill="none" stroke="red" points="469,-88 469,-307 1995,-307 1995,-88 469,-88"/>
<text text-anchor="middle" x="1232" y="-291.8" font-family="Times,serif" font-size="14.00">寻找 src CPU</text>
</g>
<g id="clust8" class="cluster">
<title>cluster_3</title>
<polygon fill="none" stroke="red" points="2003,-160 2003,-307 2824,-307 2824,-160 2003,-160"/>
<text text-anchor="middle" x="2413.5" y="-291.8" font-family="Times,serif" font-size="14.00">Normal Migration</text>
</g>
<g id="clust11" class="cluster">
<title>cluster_4</title>
<polygon fill="none" stroke="red" points="2832,-16 2832,-307 3210,-307 3210,-16 2832,-16"/>
<text text-anchor="middle" x="3021" y="-291.8" font-family="Times,serif" font-size="14.00">Active Migration</text>
</g>
<!-- rebalance_domains -->
<g id="node1" class="node">
<title>rebalance_domains</title>
<ellipse fill="palegreen" stroke="black" cx="1978" cy="-408" rx="99.38" ry="18"/>
<text text-anchor="middle" x="1978" y="-404.3" font-family="Times,serif" font-size="14.00">rebalance_domains</text>
</g>
<!-- load_balance -->
<g id="node2" class="node">
<title>load_balance</title>
<ellipse fill="palegreen" stroke="black" cx="2080" cy="-333" rx="70.39" ry="18"/>
<text text-anchor="middle" x="2080" y="-329.3" font-family="Times,serif" font-size="14.00">load_balance</text>
</g>
<!-- rebalance_domains&#45;&gt;load_balance -->
<g id="edge1" class="edge">
<title>rebalance_domains&#45;&gt;load_balance</title>
<path fill="none" stroke="black" d="M2001.15,-390.44C2015.33,-380.28 2033.66,-367.17 2049.08,-356.13"/>
<polygon fill="black" stroke="black" points="2051.2,-358.91 2057.3,-350.25 2047.13,-353.22 2051.2,-358.91"/>
</g>
<!-- should_we_balance -->
<g id="node4" class="node">
<title>should_we_balance</title>
<ellipse fill="none" stroke="black" cx="354" cy="-258" rx="98.58" ry="18"/>
<text text-anchor="middle" x="354" y="-254.3" font-family="Times,serif" font-size="14.00">should_we_balance</text>
</g>
<!-- load_balance&#45;&gt;should_we_balance -->
<g id="edge3" class="edge">
<title>load_balance:s&#45;&gt;should_we_balance</title>
<path fill="none" stroke="black" d="M2080,-315C2080,-303.78 475.98,-309.3 465,-307 439.7,-301.7 413.05,-290.39 392.21,-280.08"/>
<polygon fill="black" stroke="black" points="393.57,-276.85 383.07,-275.44 390.4,-283.09 393.57,-276.85"/>
</g>
<!-- find_busiest_group -->
<g id="node5" class="node">
<title>find_busiest_group</title>
<ellipse fill="lightyellow" stroke="black" cx="1438" cy="-258" rx="98.28" ry="18"/>
<text text-anchor="middle" x="1438" y="-254.3" font-family="Times,serif" font-size="14.00">find_busiest_group</text>
</g>
<!-- load_balance&#45;&gt;find_busiest_group -->
<g id="edge4" class="edge">
<title>load_balance:s&#45;&gt;find_busiest_group</title>
<path fill="none" stroke="black" d="M2080,-315C2080,-313.31 1714.73,-282.31 1535.23,-267.18"/>
<polygon fill="black" stroke="black" points="1535.51,-263.69 1525.25,-266.33 1534.92,-270.66 1535.51,-263.69"/>
</g>
<!-- find_busiest_queue -->
<g id="node6" class="node">
<title>find_busiest_queue</title>
<ellipse fill="lightyellow" stroke="black" cx="844" cy="-258" rx="98.58" ry="18"/>
<text text-anchor="middle" x="844" y="-254.3" font-family="Times,serif" font-size="14.00">find_busiest_queue</text>
</g>
<!-- load_balance&#45;&gt;find_busiest_queue -->
<g id="edge5" class="edge">
<title>load_balance:s&#45;&gt;find_busiest_queue</title>
<path fill="none" stroke="black" d="M2080,-315C2080,-304.6 1341.39,-307.57 1331,-307 1191.51,-299.4 1030.29,-281.76 932.81,-270.11"/>
<polygon fill="black" stroke="black" points="933.05,-266.62 922.7,-268.9 932.22,-273.57 933.05,-266.62"/>
</g>
<!-- detach_tasks -->
<g id="node7" class="node">
<title>detach_tasks</title>
<ellipse fill="none" stroke="black" cx="2380" cy="-258" rx="70.69" ry="18"/>
<text text-anchor="middle" x="2380" y="-254.3" font-family="Times,serif" font-size="14.00">detach_tasks</text>
</g>
<!-- load_balance&#45;&gt;detach_tasks -->
<g id="edge6" class="edge">
<title>load_balance:s&#45;&gt;detach_tasks</title>
<path fill="none" stroke="black" d="M2080,-315C2080,-306.29 2149.4,-308.37 2158,-307 2213.94,-298.11 2276.99,-284.09 2321.57,-273.49"/>
<polygon fill="black" stroke="black" points="2322.44,-276.88 2331.35,-271.14 2320.81,-270.07 2322.44,-276.88"/>
</g>
<!-- attach_tasks -->
<g id="node8" class="node">
<title>attach_tasks</title>
<ellipse fill="none" stroke="black" cx="2080" cy="-258" rx="68.79" ry="18"/>
<text text-anchor="middle" x="2080" y="-254.3" font-family="Times,serif" font-size="14.00">attach_tasks</text>
</g>
<!-- load_balance&#45;&gt;attach_tasks -->
<g id="edge7" class="edge">
<title>load_balance:s&#45;&gt;attach_tasks</title>
<path fill="none" stroke="black" d="M2080,-315C2080,-305.64 2080,-295.39 2080,-286.25"/>
<polygon fill="black" stroke="black" points="2083.5,-286.16 2080,-276.16 2076.5,-286.16 2083.5,-286.16"/>
</g>
<!-- need_active_balance -->
<g id="node9" class="node">
<title>need_active_balance</title>
<ellipse fill="none" stroke="black" cx="2945" cy="-258" rx="105.08" ry="18"/>
<text text-anchor="middle" x="2945" y="-254.3" font-family="Times,serif" font-size="14.00">need_active_balance</text>
</g>
<!-- load_balance&#45;&gt;need_active_balance -->
<g id="edge8" class="edge">
<title>load_balance:s&#45;&gt;need_active_balance</title>
<path fill="none" stroke="black" d="M2080,-315C2080,-304.61 2817.82,-309.06 2828,-307 2854.74,-301.58 2883.08,-290.11 2905.17,-279.75"/>
<polygon fill="black" stroke="black" points="2906.74,-282.88 2914.24,-275.39 2903.71,-276.57 2906.74,-282.88"/>
</g>
<!-- stop_one_cpu_nowait -->
<g id="node10" class="node">
<title>stop_one_cpu_nowait</title>
<ellipse fill="none" stroke="black" cx="3021" cy="-186" rx="108.58" ry="18"/>
<text text-anchor="middle" x="3021" y="-182.3" font-family="Times,serif" font-size="14.00">stop_one_cpu_nowait</text>
</g>
<!-- load_balance&#45;&gt;stop_one_cpu_nowait -->
<g id="edge9" class="edge">
<title>load_balance:s&#45;&gt;stop_one_cpu_nowait</title>
<path fill="none" stroke="black" d="M2080,-315C2080,-301.4 3049.42,-316.65 3059,-307 3084.27,-281.52 3061.48,-239.35 3041.89,-212.38"/>
<polygon fill="black" stroke="black" points="3044.53,-210.07 3035.71,-204.21 3038.95,-214.29 3044.53,-210.07"/>
</g>
<!-- newidle_balance -->
<g id="node3" class="node">
<title>newidle_balance</title>
<ellipse fill="palegreen" stroke="black" cx="2183" cy="-408" rx="87.18" ry="18"/>
<text text-anchor="middle" x="2183" y="-404.3" font-family="Times,serif" font-size="14.00">newidle_balance</text>
</g>
<!-- newidle_balance&#45;&gt;load_balance -->
<g id="edge2" class="edge">
<title>newidle_balance&#45;&gt;load_balance</title>
<path fill="none" stroke="black" d="M2159.88,-390.62C2145.47,-380.4 2126.75,-367.13 2111.05,-356"/>
<polygon fill="black" stroke="black" points="2112.87,-353 2102.68,-350.08 2108.82,-358.71 2112.87,-353"/>
</g>
<!-- group_balance_mask -->
<g id="node11" class="node">
<title>group_balance_mask</title>
<ellipse fill="none" stroke="black" cx="131" cy="-186" rx="106.68" ry="18"/>
<text text-anchor="middle" x="131" y="-182.3" font-family="Times,serif" font-size="14.00">group_balance_mask</text>
</g>
<!-- should_we_balance&#45;&gt;group_balance_mask -->
<g id="edge10" class="edge">
<title>should_we_balance&#45;&gt;group_balance_mask</title>
<path fill="none" stroke="black" d="M306.71,-242.15C272.32,-231.36 225.57,-216.69 188.94,-205.19"/>
<polygon fill="black" stroke="black" points="189.97,-201.84 179.38,-202.19 187.87,-208.52 189.97,-201.84"/>
</g>
<!-- group_balance_cpu -->
<g id="node12" class="node">
<title>group_balance_cpu</title>
<ellipse fill="none" stroke="black" cx="354" cy="-186" rx="98.58" ry="18"/>
<text text-anchor="middle" x="354" y="-182.3" font-family="Times,serif" font-size="14.00">group_balance_cpu</text>
</g>
<!-- should_we_balance&#45;&gt;group_balance_cpu -->
<g id="edge11" class="edge">
<title>should_we_balance&#45;&gt;group_balance_cpu</title>
<path fill="none" stroke="black" d="M354,-239.7C354,-231.98 354,-222.71 354,-214.11"/>
<polygon fill="black" stroke="black" points="357.5,-214.1 354,-204.1 350.5,-214.1 357.5,-214.1"/>
</g>
<!-- init_sd_lb_stats -->
<g id="node13" class="node">
<title>init_sd_lb_stats</title>
<ellipse fill="none" stroke="black" cx="855" cy="-186" rx="81.79" ry="18"/>
<text text-anchor="middle" x="855" y="-182.3" font-family="Times,serif" font-size="14.00">init_sd_lb_stats</text>
</g>
<!-- find_busiest_group&#45;&gt;init_sd_lb_stats -->
<g id="edge12" class="edge">
<title>find_busiest_group&#45;&gt;init_sd_lb_stats</title>
<path fill="none" stroke="black" d="M1350.64,-249.65C1252.08,-240.87 1087.09,-224.75 946,-204 938.7,-202.93 931.1,-201.69 923.53,-200.39"/>
<polygon fill="black" stroke="black" points="924.09,-196.93 913.63,-198.64 922.87,-203.83 924.09,-196.93"/>
</g>
<!-- update_sd_lb_stats -->
<g id="node14" class="node">
<title>update_sd_lb_stats</title>
<ellipse fill="none" stroke="black" cx="1054" cy="-186" rx="98.58" ry="18"/>
<text text-anchor="middle" x="1054" y="-182.3" font-family="Times,serif" font-size="14.00">update_sd_lb_stats</text>
</g>
<!-- find_busiest_group&#45;&gt;update_sd_lb_stats -->
<g id="edge13" class="edge">
<title>find_busiest_group&#45;&gt;update_sd_lb_stats</title>
<path fill="none" stroke="black" d="M1371.11,-244.81C1304.24,-232.62 1201.51,-213.89 1131.21,-201.08"/>
<polygon fill="black" stroke="black" points="1131.55,-197.58 1121.09,-199.23 1130.3,-204.47 1131.55,-197.58"/>
</g>
<!-- sched_energy_enabled -->
<g id="node15" class="node">
<title>sched_energy_enabled</title>
<ellipse fill="none" stroke="black" cx="1286" cy="-186" rx="115.08" ry="18"/>
<text text-anchor="middle" x="1286" y="-182.3" font-family="Times,serif" font-size="14.00">sched_energy_enabled</text>
</g>
<!-- find_busiest_group&#45;&gt;sched_energy_enabled -->
<g id="edge14" class="edge">
<title>find_busiest_group&#45;&gt;sched_energy_enabled</title>
<path fill="none" stroke="black" d="M1403.51,-241.12C1381.88,-231.15 1353.77,-218.21 1330.47,-207.48"/>
<polygon fill="black" stroke="black" points="1331.69,-204.19 1321.14,-203.19 1328.76,-210.55 1331.69,-204.19"/>
</g>
<!-- compare_local_busiest_group_type -->
<g id="node16" class="node">
<title>compare_local_busiest_group_type</title>
<ellipse fill="none" stroke="black" cx="1590" cy="-186" rx="170.87" ry="18"/>
<text text-anchor="middle" x="1590" y="-182.3" font-family="Times,serif" font-size="14.00">compare_local_busiest_group_type</text>
</g>
<!-- find_busiest_group&#45;&gt;compare_local_busiest_group_type -->
<g id="edge15" class="edge">
<title>find_busiest_group&#45;&gt;compare_local_busiest_group_type</title>
<path fill="none" stroke="black" d="M1472.49,-241.12C1493.82,-231.3 1521.43,-218.58 1544.53,-207.94"/>
<polygon fill="black" stroke="black" points="1546.17,-211.04 1553.79,-203.67 1543.25,-204.68 1546.17,-211.04"/>
</g>
<!-- calculate_imbalance -->
<g id="node17" class="node">
<title>calculate_imbalance</title>
<ellipse fill="none" stroke="black" cx="1883" cy="-186" rx="103.98" ry="18"/>
<text text-anchor="middle" x="1883" y="-182.3" font-family="Times,serif" font-size="14.00">calculate_imbalance</text>
</g>
<!-- find_busiest_group&#45;&gt;calculate_imbalance -->
<g id="edge16" class="edge">
<title>find_busiest_group&#45;&gt;calculate_imbalance</title>
<path fill="none" stroke="black" d="M1509.99,-245.68C1588.94,-233.26 1715.49,-213.35 1798.93,-200.22"/>
<polygon fill="black" stroke="black" points="1799.55,-203.67 1808.89,-198.66 1798.46,-196.75 1799.55,-203.67"/>
</g>
<!-- for_each_sched_group_span -->
<g id="node18" class="node">
<title>for_each_sched_group_span</title>
<ellipse fill="none" stroke="black" cx="616" cy="-186" rx="139.18" ry="18"/>
<text text-anchor="middle" x="616" y="-182.3" font-family="Times,serif" font-size="14.00">for_each_sched_group_span</text>
</g>
<!-- find_busiest_queue&#45;&gt;for_each_sched_group_span -->
<g id="edge17" class="edge">
<title>find_busiest_queue&#45;&gt;for_each_sched_group_span</title>
<path fill="none" stroke="black" d="M795.93,-242.24C761.39,-231.64 714.54,-217.25 677.31,-205.82"/>
<polygon fill="black" stroke="black" points="678.16,-202.42 667.58,-202.83 676.11,-209.12 678.16,-202.42"/>
</g>
<!-- can_migrate_task -->
<g id="node21" class="node">
<title>can_migrate_task</title>
<ellipse fill="lightyellow" stroke="black" cx="2248" cy="-186" rx="91.78" ry="18"/>
<text text-anchor="middle" x="2248" y="-182.3" font-family="Times,serif" font-size="14.00">can_migrate_task</text>
</g>
<!-- detach_tasks&#45;&gt;can_migrate_task -->
<g id="edge20" class="edge">
<title>detach_tasks&#45;&gt;can_migrate_task</title>
<path fill="none" stroke="black" d="M2350.7,-241.46C2332.13,-231.61 2307.87,-218.75 2287.59,-208"/>
<polygon fill="black" stroke="black" points="2289.06,-204.81 2278.59,-203.22 2285.78,-211 2289.06,-204.81"/>
</g>
<!-- switch_env_migration_type_DT -->
<g id="node22" class="node">
<title>switch_env_migration_type_DT</title>
<ellipse fill="none" stroke="black" cx="2512" cy="-186" rx="154.07" ry="18"/>
<text text-anchor="middle" x="2512" y="-182.3" font-family="Times,serif" font-size="14.00">switch_env_migration_type_DT</text>
</g>
<!-- detach_tasks&#45;&gt;switch_env_migration_type_DT -->
<g id="edge21" class="edge">
<title>detach_tasks&#45;&gt;switch_env_migration_type_DT</title>
<path fill="none" stroke="black" d="M2409.3,-241.46C2427.61,-231.75 2451.44,-219.11 2471.54,-208.45"/>
<polygon fill="black" stroke="black" points="2473.29,-211.49 2480.48,-203.71 2470.01,-205.31 2473.29,-211.49"/>
</g>
<!-- detach_task -->
<g id="node23" class="node">
<title>detach_task</title>
<ellipse fill="none" stroke="black" cx="2750" cy="-186" rx="65.79" ry="18"/>
<text text-anchor="middle" x="2750" y="-182.3" font-family="Times,serif" font-size="14.00">detach_task</text>
</g>
<!-- detach_tasks&#45;&gt;detach_task -->
<g id="edge22" class="edge">
<title>detach_tasks&#45;&gt;detach_task</title>
<path fill="none" stroke="black" d="M2437.53,-247.46C2497.09,-237.39 2592.77,-220.7 2675,-204 2680.4,-202.9 2686,-201.72 2691.61,-200.5"/>
<polygon fill="black" stroke="black" points="2692.64,-203.86 2701.66,-198.3 2691.14,-197.02 2692.64,-203.86"/>
</g>
<!-- attach_task -->
<g id="node24" class="node">
<title>attach_task</title>
<ellipse fill="none" stroke="black" cx="2075" cy="-186" rx="63.89" ry="18"/>
<text text-anchor="middle" x="2075" y="-182.3" font-family="Times,serif" font-size="14.00">attach_task</text>
</g>
<!-- attach_tasks&#45;&gt;attach_task -->
<g id="edge23" class="edge">
<title>attach_tasks&#45;&gt;attach_task</title>
<path fill="none" stroke="black" d="M2078.76,-239.7C2078.21,-231.98 2077.55,-222.71 2076.94,-214.11"/>
<polygon fill="black" stroke="black" points="2080.43,-213.83 2076.22,-204.1 2073.44,-214.33 2080.43,-213.83"/>
</g>
<!-- need_active_balance&#45;&gt;stop_one_cpu_nowait -->
<g id="edge24" class="edge">
<title>need_active_balance&#45;&gt;stop_one_cpu_nowait</title>
<path fill="none" stroke="black" stroke-dasharray="5,2" d="M2963.4,-240.05C2972.92,-231.28 2984.7,-220.43 2995.13,-210.83"/>
<polygon fill="black" stroke="black" points="2997.79,-213.14 3002.77,-203.79 2993.05,-207.99 2997.79,-213.14"/>
</g>
<!-- active_load_balance_cpu_stop -->
<g id="node25" class="node">
<title>active_load_balance_cpu_stop</title>
<ellipse fill="lightyellow" stroke="black" cx="3021" cy="-114" rx="147.57" ry="18"/>
<text text-anchor="middle" x="3021" y="-110.3" font-family="Times,serif" font-size="14.00">active_load_balance_cpu_stop</text>
</g>
<!-- stop_one_cpu_nowait&#45;&gt;active_load_balance_cpu_stop -->
<g id="edge25" class="edge">
<title>stop_one_cpu_nowait&#45;&gt;active_load_balance_cpu_stop</title>
<path fill="none" stroke="black" stroke-dasharray="5,2" d="M3021,-167.7C3021,-159.98 3021,-150.71 3021,-142.11"/>
<polygon fill="black" stroke="black" points="3024.5,-142.1 3021,-132.1 3017.5,-142.1 3024.5,-142.1"/>
</g>
<!-- fbq_classify_rq -->
<g id="node19" class="node">
<title>fbq_classify_rq</title>
<ellipse fill="none" stroke="black" cx="586" cy="-114" rx="79.09" ry="18"/>
<text text-anchor="middle" x="586" y="-110.3" font-family="Times,serif" font-size="14.00">fbq_classify_rq</text>
</g>
<!-- for_each_sched_group_span&#45;&gt;fbq_classify_rq -->
<g id="edge18" class="edge">
<title>for_each_sched_group_span&#45;&gt;fbq_classify_rq</title>
<path fill="none" stroke="black" d="M608.58,-167.7C605.21,-159.81 601.13,-150.3 597.38,-141.55"/>
<polygon fill="black" stroke="black" points="600.49,-139.92 593.33,-132.1 594.05,-142.67 600.49,-139.92"/>
</g>
<!-- switch_env_migration_type_FBQ -->
<g id="node20" class="node">
<title>switch_env_migration_type_FBQ</title>
<ellipse fill="none" stroke="black" cx="844" cy="-114" rx="161.37" ry="18"/>
<text text-anchor="middle" x="844" y="-110.3" font-family="Times,serif" font-size="14.00">switch_env_migration_type_FBQ</text>
</g>
<!-- for_each_sched_group_span&#45;&gt;switch_env_migration_type_FBQ -->
<g id="edge19" class="edge">
<title>for_each_sched_group_span&#45;&gt;switch_env_migration_type_FBQ</title>
<path fill="none" stroke="black" d="M667.45,-169.2C701.31,-158.81 745.82,-145.14 781.68,-134.13"/>
<polygon fill="black" stroke="black" points="783.02,-137.38 791.55,-131.1 780.96,-130.69 783.02,-137.38"/>
</g>
<!-- detach_one_task -->
<g id="node26" class="node">
<title>detach_one_task</title>
<ellipse fill="none" stroke="black" cx="2927" cy="-42" rx="87.18" ry="18"/>
<text text-anchor="middle" x="2927" y="-38.3" font-family="Times,serif" font-size="14.00">detach_one_task</text>
</g>
<!-- active_load_balance_cpu_stop&#45;&gt;detach_one_task -->
<g id="edge26" class="edge">
<title>active_load_balance_cpu_stop&#45;&gt;detach_one_task</title>
<path fill="none" stroke="black" d="M2998.25,-96.05C2986.03,-86.96 2970.81,-75.63 2957.58,-65.77"/>
<polygon fill="black" stroke="black" points="2959.33,-62.71 2949.22,-59.55 2955.15,-68.33 2959.33,-62.71"/>
</g>
<!-- attach_one_task -->
<g id="node27" class="node">
<title>attach_one_task</title>
<ellipse fill="none" stroke="black" cx="3117" cy="-42" rx="85.29" ry="18"/>
<text text-anchor="middle" x="3117" y="-38.3" font-family="Times,serif" font-size="14.00">attach_one_task</text>
</g>
<!-- active_load_balance_cpu_stop&#45;&gt;attach_one_task -->
<g id="edge27" class="edge">
<title>active_load_balance_cpu_stop&#45;&gt;attach_one_task</title>
<path fill="none" stroke="black" d="M3044.24,-96.05C3056.83,-86.87 3072.55,-75.41 3086.16,-65.49"/>
<polygon fill="black" stroke="black" points="3088.29,-68.27 3094.31,-59.55 3084.16,-62.61 3088.29,-68.27"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 19 KiB

@@ -1,17 +1,28 @@
digraph newidle_balance {
// IDLE 负载均衡器
__schedule -> pick_next_task;// -> {__pick_next_task, put_prev_task_balance};
pick_next_task -> __pick_next_task [label="!sched_core_enabled(rq)"];
pick_next_task -> put_prev_task_balance [label="sched_core_enabled"];
subgraph cluster_1 {
label = "触发 New Idle Load Balance";
color=red;
__pick_next_task -> {pick_next_task_fair, pick_next_task_idle, put_prev_task_balance, class_pick_next_task};
class_pick_next_task -> pick_next_task_fair [style=dashed];
put_prev_task_balance -> for_class_range_prev_to_idle -> class_balance -> balance_fair -> newidle_balance;
pick_next_task_fair -> newidle_balance
newidle_balance -> {update_misfit_status, update_next_balance, update_blocked_averages, for_each_domain_ILB} -> nohz_newidle_balance;
__schedule -> pick_next_task;// -> {__pick_next_task, put_prev_task_balance};
pick_next_task -> __pick_next_task [label="!sched_core_enabled(rq)"];
pick_next_task -> put_prev_task_balance [label="sched_core_enabled"];
for_each_domain_ILB -> {update_next_balance, load_balance, update_newidle_cost};
nohz_newidle_balance -> set_NOHZ_NEWILB_KICK
__pick_next_task -> {pick_next_task_fair, pick_next_task_idle, put_prev_task_balance, class_pick_next_task};
class_pick_next_task -> pick_next_task_fair [style=dashed];
put_prev_task_balance -> for_class_range_prev_to_idle -> class_balance -> balance_fair -> newidle_balance;
pick_next_task_fair -> newidle_balance;
};
subgraph cluster_2 {
label = "执行 New Idle Load Balance";
color=blue;
newidle_balance -> {update_misfit_status, update_next_balance, update_blocked_averages, for_each_domain_ILB} -> nohz_newidle_balance;
for_each_domain_ILB -> {update_next_balance, load_balance, update_newidle_cost};
nohz_newidle_balance -> set_NOHZ_NEWILB_KICK
};
// caller
pick_next_task_fair [label="pick_next_task_fair"; style=filled; fillcolor=lightyellow; shape=oval];
@@ -0,0 +1,289 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.43.0 (0)
-->
<!-- Title: newidle_balance Pages: 1 -->
<svg width="1173pt" height="937pt"
viewBox="0.00 0.00 1173.00 937.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 933)">
<title>newidle_balance</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-933 1169,-933 1169,4 -4,4"/>
<g id="clust1" class="cluster">
<title>cluster_1</title>
<polygon fill="none" stroke="red" points="26,-321 26,-921 755,-921 755,-321 26,-321"/>
<text text-anchor="middle" x="390.5" y="-905.8" font-family="Times,serif" font-size="14.00">触发 New Idle Load Balance</text>
</g>
<g id="clust3" class="cluster">
<title>cluster_2</title>
<polygon fill="none" stroke="blue" points="8,-8 8,-302 1157,-302 1157,-8 8,-8"/>
<text text-anchor="middle" x="582.5" y="-286.8" font-family="Times,serif" font-size="14.00">执行 New Idle Load Balance</text>
</g>
<!-- __schedule -->
<g id="node1" class="node">
<title>__schedule</title>
<ellipse fill="none" stroke="black" cx="495" cy="-872" rx="60.39" ry="18"/>
<text text-anchor="middle" x="495" y="-868.3" font-family="Times,serif" font-size="14.00">__schedule</text>
</g>
<!-- pick_next_task -->
<g id="node2" class="node">
<title>pick_next_task</title>
<ellipse fill="none" stroke="black" cx="495" cy="-799" rx="78.79" ry="18"/>
<text text-anchor="middle" x="495" y="-795.3" font-family="Times,serif" font-size="14.00">pick_next_task</text>
</g>
<!-- __schedule&#45;&gt;pick_next_task -->
<g id="edge1" class="edge">
<title>__schedule&#45;&gt;pick_next_task</title>
<path fill="none" stroke="black" d="M495,-853.81C495,-845.79 495,-836.05 495,-827.07"/>
<polygon fill="black" stroke="black" points="498.5,-827.03 495,-817.03 491.5,-827.03 498.5,-827.03"/>
</g>
<!-- __pick_next_task -->
<g id="node3" class="node">
<title>__pick_next_task</title>
<ellipse fill="none" stroke="black" cx="385" cy="-712" rx="87.18" ry="18"/>
<text text-anchor="middle" x="385" y="-708.3" font-family="Times,serif" font-size="14.00">__pick_next_task</text>
</g>
<!-- pick_next_task&#45;&gt;__pick_next_task -->
<g id="edge2" class="edge">
<title>pick_next_task&#45;&gt;__pick_next_task</title>
<path fill="none" stroke="black" d="M450.22,-784.13C437.89,-778.86 425.13,-771.91 415,-763 407.52,-756.42 401.36,-747.51 396.61,-739.04"/>
<polygon fill="black" stroke="black" points="399.71,-737.42 392.01,-730.14 393.49,-740.63 399.71,-737.42"/>
<text text-anchor="middle" x="502.5" y="-751.8" font-family="Times,serif" font-size="14.00">!sched_core_enabled(rq)</text>
</g>
<!-- put_prev_task_balance -->
<g id="node4" class="node">
<title>put_prev_task_balance</title>
<ellipse fill="none" stroke="black" cx="631" cy="-639" rx="115.88" ry="18"/>
<text text-anchor="middle" x="631" y="-635.3" font-family="Times,serif" font-size="14.00">put_prev_task_balance</text>
</g>
<!-- pick_next_task&#45;&gt;put_prev_task_balance -->
<g id="edge3" class="edge">
<title>pick_next_task&#45;&gt;put_prev_task_balance</title>
<path fill="none" stroke="black" d="M551.62,-786.37C565.64,-781.19 579.6,-773.73 590,-763 615.31,-736.89 625,-694.75 628.71,-667.21"/>
<polygon fill="black" stroke="black" points="632.21,-667.42 629.89,-657.09 625.26,-666.61 632.21,-667.42"/>
<text text-anchor="middle" x="694" y="-708.3" font-family="Times,serif" font-size="14.00">sched_core_enabled</text>
</g>
<!-- __pick_next_task&#45;&gt;put_prev_task_balance -->
<g id="edge4" class="edge">
<title>__pick_next_task&#45;&gt;put_prev_task_balance</title>
<path fill="none" stroke="black" d="M433.6,-696.97C472.36,-685.79 526.91,-670.04 568.84,-657.94"/>
<polygon fill="black" stroke="black" points="570.03,-661.24 578.67,-655.1 568.09,-654.51 570.03,-661.24"/>
</g>
<!-- pick_next_task_fair -->
<g id="node5" class="node">
<title>pick_next_task_fair</title>
<ellipse fill="lightyellow" stroke="black" cx="344" cy="-566" rx="98.58" ry="18"/>
<text text-anchor="middle" x="344" y="-562.3" font-family="Times,serif" font-size="14.00">pick_next_task_fair</text>
</g>
<!-- __pick_next_task&#45;&gt;pick_next_task_fair -->
<g id="edge5" class="edge">
<title>__pick_next_task&#45;&gt;pick_next_task_fair</title>
<path fill="none" stroke="black" d="M298.39,-709.58C208.6,-706.06 76.97,-694.44 45,-657 -12.97,-589.1 127.39,-571.32 234.89,-567.27"/>
<polygon fill="black" stroke="black" points="235.31,-570.75 245.18,-566.92 235.07,-563.76 235.31,-570.75"/>
</g>
<!-- pick_next_task_idle -->
<g id="node6" class="node">
<title>pick_next_task_idle</title>
<ellipse fill="none" stroke="black" cx="154" cy="-639" rx="100.18" ry="18"/>
<text text-anchor="middle" x="154" y="-635.3" font-family="Times,serif" font-size="14.00">pick_next_task_idle</text>
</g>
<!-- __pick_next_task&#45;&gt;pick_next_task_idle -->
<g id="edge6" class="edge">
<title>__pick_next_task&#45;&gt;pick_next_task_idle</title>
<path fill="none" stroke="black" d="M338.53,-696.72C302.09,-685.52 251.18,-669.87 212.06,-657.85"/>
<polygon fill="black" stroke="black" points="212.97,-654.46 202.38,-654.87 210.91,-661.15 212.97,-654.46"/>
</g>
<!-- class_pick_next_task -->
<g id="node7" class="node">
<title>class_pick_next_task</title>
<ellipse fill="lightyellow" stroke="black" cx="385" cy="-639" rx="112.38" ry="18"/>
<text text-anchor="middle" x="385" y="-635.3" font-family="Times,serif" font-size="14.00">class&#45;&gt;pick_next_task</text>
</g>
<!-- __pick_next_task&#45;&gt;class_pick_next_task -->
<g id="edge7" class="edge">
<title>__pick_next_task&#45;&gt;class_pick_next_task</title>
<path fill="none" stroke="black" d="M385,-693.81C385,-685.79 385,-676.05 385,-667.07"/>
<polygon fill="black" stroke="black" points="388.5,-667.03 385,-657.03 381.5,-667.03 388.5,-667.03"/>
</g>
<!-- for_class_range_prev_to_idle -->
<g id="node8" class="node">
<title>for_class_range_prev_to_idle</title>
<ellipse fill="none" stroke="black" cx="604" cy="-566" rx="142.97" ry="18"/>
<text text-anchor="middle" x="604" y="-562.3" font-family="Times,serif" font-size="14.00">for_class_range_prev_to_idle</text>
</g>
<!-- put_prev_task_balance&#45;&gt;for_class_range_prev_to_idle -->
<g id="edge9" class="edge">
<title>put_prev_task_balance&#45;&gt;for_class_range_prev_to_idle</title>
<path fill="none" stroke="black" d="M624.46,-620.81C621.35,-612.62 617.55,-602.62 614.07,-593.48"/>
<polygon fill="black" stroke="black" points="617.3,-592.13 610.48,-584.03 610.76,-594.62 617.3,-592.13"/>
</g>
<!-- newidle_balance -->
<g id="node11" class="node">
<title>newidle_balance</title>
<ellipse fill="palegreen" stroke="black" cx="395" cy="-347" rx="87.18" ry="18"/>
<text text-anchor="middle" x="395" y="-343.3" font-family="Times,serif" font-size="14.00">newidle_balance</text>
</g>
<!-- pick_next_task_fair&#45;&gt;newidle_balance -->
<g id="edge13" class="edge">
<title>pick_next_task_fair&#45;&gt;newidle_balance</title>
<path fill="none" stroke="black" d="M348,-547.97C356.81,-510.51 377.92,-420.68 388.59,-375.26"/>
<polygon fill="black" stroke="black" points="392.07,-375.78 390.95,-365.25 385.25,-374.18 392.07,-375.78"/>
</g>
<!-- class_pick_next_task&#45;&gt;pick_next_task_fair -->
<g id="edge8" class="edge">
<title>class_pick_next_task&#45;&gt;pick_next_task_fair</title>
<path fill="none" stroke="black" stroke-dasharray="5,2" d="M375.08,-620.81C370.24,-612.44 364.33,-602.2 358.96,-592.9"/>
<polygon fill="black" stroke="black" points="361.87,-590.94 353.83,-584.03 355.8,-594.44 361.87,-590.94"/>
</g>
<!-- class_balance -->
<g id="node9" class="node">
<title>class_balance</title>
<ellipse fill="lightyellow" stroke="black" cx="540" cy="-493" rx="79.89" ry="18"/>
<text text-anchor="middle" x="540" y="-489.3" font-family="Times,serif" font-size="14.00">class&#45;&gt;balance</text>
</g>
<!-- for_class_range_prev_to_idle&#45;&gt;class_balance -->
<g id="edge10" class="edge">
<title>for_class_range_prev_to_idle&#45;&gt;class_balance</title>
<path fill="none" stroke="black" d="M588.51,-547.81C580.57,-539 570.76,-528.13 562.05,-518.46"/>
<polygon fill="black" stroke="black" points="564.65,-516.11 555.35,-511.03 559.45,-520.8 564.65,-516.11"/>
</g>
<!-- balance_fair -->
<g id="node10" class="node">
<title>balance_fair</title>
<ellipse fill="lightyellow" stroke="black" cx="493" cy="-420" rx="66.89" ry="18"/>
<text text-anchor="middle" x="493" y="-416.3" font-family="Times,serif" font-size="14.00">balance_fair</text>
</g>
<!-- class_balance&#45;&gt;balance_fair -->
<g id="edge11" class="edge">
<title>class_balance&#45;&gt;balance_fair</title>
<path fill="none" stroke="black" d="M528.86,-475.17C523.21,-466.63 516.22,-456.08 509.92,-446.56"/>
<polygon fill="black" stroke="black" points="512.82,-444.61 504.38,-438.2 506.99,-448.47 512.82,-444.61"/>
</g>
<!-- balance_fair&#45;&gt;newidle_balance -->
<g id="edge12" class="edge">
<title>balance_fair&#45;&gt;newidle_balance</title>
<path fill="none" stroke="black" d="M470.76,-402.89C457.54,-393.31 440.58,-381.02 426.05,-370.5"/>
<polygon fill="black" stroke="black" points="427.98,-367.57 417.83,-364.54 423.87,-373.24 427.98,-367.57"/>
</g>
<!-- update_misfit_status -->
<g id="node12" class="node">
<title>update_misfit_status</title>
<ellipse fill="none" stroke="black" cx="123" cy="-180" rx="106.68" ry="18"/>
<text text-anchor="middle" x="123" y="-176.3" font-family="Times,serif" font-size="14.00">update_misfit_status</text>
</g>
<!-- newidle_balance&#45;&gt;update_misfit_status -->
<g id="edge14" class="edge">
<title>newidle_balance&#45;&gt;update_misfit_status</title>
<path fill="none" stroke="black" d="M367.93,-329.58C318.66,-299.69 214.38,-236.43 159.12,-202.91"/>
<polygon fill="black" stroke="black" points="160.73,-199.8 150.37,-197.6 157.1,-205.78 160.73,-199.8"/>
</g>
<!-- update_next_balance -->
<g id="node13" class="node">
<title>update_next_balance</title>
<ellipse fill="none" stroke="black" cx="355" cy="-180" rx="107.78" ry="18"/>
<text text-anchor="middle" x="355" y="-176.3" font-family="Times,serif" font-size="14.00">update_next_balance</text>
</g>
<!-- newidle_balance&#45;&gt;update_next_balance -->
<g id="edge15" class="edge">
<title>newidle_balance&#45;&gt;update_next_balance</title>
<path fill="none" stroke="black" d="M385.42,-328.91C381.33,-320.95 376.86,-311.22 374,-302 364.29,-270.68 359.39,-233.2 357.02,-208.33"/>
<polygon fill="black" stroke="black" points="360.49,-207.84 356.13,-198.19 353.52,-208.45 360.49,-207.84"/>
</g>
<!-- update_blocked_averages -->
<g id="node14" class="node">
<title>update_blocked_averages</title>
<ellipse fill="none" stroke="black" cx="1020" cy="-180" rx="129.18" ry="18"/>
<text text-anchor="middle" x="1020" y="-176.3" font-family="Times,serif" font-size="14.00">update_blocked_averages</text>
</g>
<!-- newidle_balance&#45;&gt;update_blocked_averages -->
<g id="edge16" class="edge">
<title>newidle_balance&#45;&gt;update_blocked_averages</title>
<path fill="none" stroke="black" d="M458.35,-334.5C501.34,-326.34 559.35,-314.63 610,-302 736.55,-270.44 882.56,-225.19 961.68,-199.92"/>
<polygon fill="black" stroke="black" points="963,-203.17 971.46,-196.79 960.87,-196.5 963,-203.17"/>
</g>
<!-- for_each_domain_ILB -->
<g id="node15" class="node">
<title>for_each_domain_ILB</title>
<ellipse fill="none" stroke="black" cx="492" cy="-253" rx="108.58" ry="18"/>
<text text-anchor="middle" x="492" y="-249.3" font-family="Times,serif" font-size="14.00">for_each_domain_ILB</text>
</g>
<!-- newidle_balance&#45;&gt;for_each_domain_ILB -->
<g id="edge17" class="edge">
<title>newidle_balance&#45;&gt;for_each_domain_ILB</title>
<path fill="none" stroke="black" d="M412.79,-329.13C427.97,-314.73 449.96,-293.87 466.92,-277.78"/>
<polygon fill="black" stroke="black" points="469.47,-280.19 474.32,-270.77 464.66,-275.11 469.47,-280.19"/>
</g>
<!-- nohz_newidle_balance -->
<g id="node16" class="node">
<title>nohz_newidle_balance</title>
<ellipse fill="none" stroke="black" cx="450" cy="-107" rx="113.18" ry="18"/>
<text text-anchor="middle" x="450" y="-103.3" font-family="Times,serif" font-size="14.00">nohz_newidle_balance</text>
</g>
<!-- update_misfit_status&#45;&gt;nohz_newidle_balance -->
<g id="edge18" class="edge">
<title>update_misfit_status&#45;&gt;nohz_newidle_balance</title>
<path fill="none" stroke="black" d="M185.66,-165.39C239.98,-153.6 318.67,-136.52 376.06,-124.05"/>
<polygon fill="black" stroke="black" points="377.13,-127.4 386.16,-121.86 375.64,-120.56 377.13,-127.4"/>
</g>
<!-- update_next_balance&#45;&gt;nohz_newidle_balance -->
<g id="edge19" class="edge">
<title>update_next_balance&#45;&gt;nohz_newidle_balance</title>
<path fill="none" stroke="black" d="M377.51,-162.17C390.05,-152.8 405.84,-141 419.48,-130.81"/>
<polygon fill="black" stroke="black" points="421.73,-133.5 427.65,-124.71 417.54,-127.89 421.73,-133.5"/>
</g>
<!-- update_blocked_averages&#45;&gt;nohz_newidle_balance -->
<g id="edge20" class="edge">
<title>update_blocked_averages&#45;&gt;nohz_newidle_balance</title>
<path fill="none" stroke="black" d="M927.15,-167.43C822.33,-154.38 652.59,-133.24 546.35,-120"/>
<polygon fill="black" stroke="black" points="546.63,-116.51 536.27,-118.75 545.76,-123.46 546.63,-116.51"/>
</g>
<!-- for_each_domain_ILB&#45;&gt;update_next_balance -->
<g id="edge22" class="edge">
<title>for_each_domain_ILB&#45;&gt;update_next_balance</title>
<path fill="none" stroke="black" d="M460.57,-235.71C441.3,-225.73 416.43,-212.84 395.67,-202.08"/>
<polygon fill="black" stroke="black" points="397.25,-198.95 386.76,-197.46 394.03,-205.17 397.25,-198.95"/>
</g>
<!-- for_each_domain_ILB&#45;&gt;nohz_newidle_balance -->
<g id="edge21" class="edge">
<title>for_each_domain_ILB&#45;&gt;nohz_newidle_balance</title>
<path fill="none" stroke="black" d="M489.08,-234.86C485.76,-216.58 479.78,-186.9 472,-162 469.15,-152.87 465.41,-143.13 461.82,-134.47"/>
<polygon fill="black" stroke="black" points="465.03,-133.07 457.89,-125.24 458.59,-135.81 465.03,-133.07"/>
</g>
<!-- load_balance -->
<g id="node17" class="node">
<title>load_balance</title>
<ellipse fill="orange" stroke="black" cx="571" cy="-180" rx="70.39" ry="18"/>
<text text-anchor="middle" x="571" y="-176.3" font-family="Times,serif" font-size="14.00">load_balance</text>
</g>
<!-- for_each_domain_ILB&#45;&gt;load_balance -->
<g id="edge23" class="edge">
<title>for_each_domain_ILB&#45;&gt;load_balance</title>
<path fill="none" stroke="black" d="M510.72,-235.17C521.03,-225.91 533.97,-214.28 545.22,-204.17"/>
<polygon fill="black" stroke="black" points="547.59,-206.75 552.69,-197.46 542.91,-201.54 547.59,-206.75"/>
</g>
<!-- update_newidle_cost -->
<g id="node18" class="node">
<title>update_newidle_cost</title>
<ellipse fill="none" stroke="black" cx="766" cy="-180" rx="106.68" ry="18"/>
<text text-anchor="middle" x="766" y="-176.3" font-family="Times,serif" font-size="14.00">update_newidle_cost</text>
</g>
<!-- for_each_domain_ILB&#45;&gt;update_newidle_cost -->
<g id="edge24" class="edge">
<title>for_each_domain_ILB&#45;&gt;update_newidle_cost</title>
<path fill="none" stroke="black" d="M547.78,-237.55C592.04,-226.08 654.01,-210.02 700.6,-197.95"/>
<polygon fill="black" stroke="black" points="701.5,-201.33 710.3,-195.43 699.74,-194.55 701.5,-201.33"/>
</g>
<!-- set_NOHZ_NEWILB_KICK -->
<g id="node19" class="node">
<title>set_NOHZ_NEWILB_KICK</title>
<ellipse fill="none" stroke="black" cx="450" cy="-34" rx="131.08" ry="18"/>
<text text-anchor="middle" x="450" y="-30.3" font-family="Times,serif" font-size="14.00">set_NOHZ_NEWILB_KICK</text>
</g>
<!-- nohz_newidle_balance&#45;&gt;set_NOHZ_NEWILB_KICK -->
<g id="edge25" class="edge">
<title>nohz_newidle_balance&#45;&gt;set_NOHZ_NEWILB_KICK</title>
<path fill="none" stroke="black" d="M450,-88.81C450,-80.79 450,-71.05 450,-62.07"/>
<polygon fill="black" stroke="black" points="453.5,-62.03 450,-52.03 446.5,-62.03 453.5,-62.03"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 16 KiB

@@ -1,30 +1,42 @@
digraph nohz_idle_balance {
// 周期性负载均衡器 run_rebalance_domains
//run_rebalance_domains -> {nohz_idle_balance, update_blocked_averages, rebalance_domains};
scheduler_tick -> trigger_load_balance -> {raise_softirq_SCHED_SOFTIRQ, nohz_balancer_kick};
run_rebalance_domains -> nohz_idle_balance [label="has NOHZ_BALANCE_KICK"];
run_rebalance_domains -> {/* nohz_idle_balance, */update_blocked_averages, rebalance_domains};
run_rebalance_domains -> {/* nohz_idle_balance, */update_blocked_averages, rebalance_domains} [style=dashed];
// KICK
nohz_balancer_kick -> {set_NOHZ_STATS_KICK, set_NOHZ_BALANCE_KICK, set_NOHZ_NEXT_KICK} -> kick_ilb -> find_new_ilb -> KICK_CPU_BY_IPI -> nohz_csd_func -> raise_softirq_SCHED_SOFTIRQ;
subgraph cluster_1 {
label = "触发 NOHZ Load Balance";
color=red;
// NOHZ 负载均衡器 nohz_idle_balance
nohz_idle_balance -> {clear_nohz_idle_balance, _nohz_idle_balance};
/*
_nohz_idle_balance -> for_each_nohz_idle_cpus_mask -> {has_NOHZ_STATS_KICK, has_NOHZ_BALANCE_KICK};
has_NOHZ_STATS_KICK -> update_nohz_stats -> update_blocked_averages;
has_NOHZ_BALANCE_KICK -> rebalance_domains;
*/
_nohz_idle_balance -> for_each_nohz_idle_cpus_mask;
for_each_nohz_idle_cpus_mask -> update_nohz_stats -> update_blocked_averages [label="has NOHZ_STATS_KICK"];
for_each_nohz_idle_cpus_mask -> rebalance_domains [label="has NOHZ_BALANCE_KICK"];
// KICK
scheduler_tick -> trigger_load_balance -> nohz_balancer_kick;
trigger_load_balance -> raise_softirq_SCHED_SOFTIRQ [style=dashed];
nohz_balancer_kick -> {set_NOHZ_STATS_KICK, set_NOHZ_BALANCE_KICK, set_NOHZ_NEXT_KICK} -> kick_ilb -> find_new_ilb -> KICK_CPU_BY_IPI -> nohz_csd_func -> raise_softirq_SCHED_SOFTIRQ;
};
subgraph cluster_2 {
label = "执行 NOHZ Load Balance";
color=blue;
raise_softirq_SCHED_SOFTIRQ -> run_rebalance_domains [style=dashed];
// NOHZ 负载均衡器 nohz_idle_balance
run_rebalance_domains -> nohz_idle_balance [label="has NOHZ_BALANCE_KICK"];
nohz_idle_balance -> {clear_nohz_idle_balance, _nohz_idle_balance};
/*
_nohz_idle_balance -> for_each_nohz_idle_cpus_mask -> {has_NOHZ_STATS_KICK, has_NOHZ_BALANCE_KICK};
has_NOHZ_STATS_KICK -> update_nohz_stats -> update_blocked_averages;
has_NOHZ_BALANCE_KICK -> rebalance_domains;
*/
_nohz_idle_balance -> for_each_nohz_idle_cpus_mask;
for_each_nohz_idle_cpus_mask -> update_nohz_stats -> update_blocked_averages [label="has NOHZ_STATS_KICK"];
for_each_nohz_idle_cpus_mask -> rebalance_domains [label="has NOHZ_BALANCE_KICK"];
};
// IDLE 负载均衡器
newidle_balance -> nohz_newidle_balance;
nohz_newidle_balance -> set_NOHZ_NEWILB_KICK
raise_softirq_SCHED_SOFTIRQ -> run_rebalance_domains [style=dashed];
raise_softirq_SCHED_SOFTIRQ [label="raise_softirq(SCHED_SOFTIRQ)"; style=filled; shape=oval]
clear_nohz_idle_balance [label="this_rq->nohz_idle_balance = 0"; style=filled; shape=oval];
@@ -0,0 +1,309 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.43.0 (0)
-->
<!-- Title: nohz_idle_balance Pages: 1 -->
<svg width="1382pt" height="1184pt"
viewBox="0.00 0.00 1381.53 1184.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 1180)">
<title>nohz_idle_balance</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-1180 1377.53,-1180 1377.53,4 -4,4"/>
<g id="clust2" class="cluster">
<title>cluster_1</title>
<polygon fill="none" stroke="red" points="8,-509 8,-1168 834,-1168 834,-509 8,-509"/>
<text text-anchor="middle" x="421" y="-1152.8" font-family="Times,serif" font-size="14.00">触发 NOHZ Load Balance</text>
</g>
<g id="clust4" class="cluster">
<title>cluster_2</title>
<polygon fill="none" stroke="blue" points="538,-8 538,-490 1123,-490 1123,-8 538,-8"/>
<text text-anchor="middle" x="830.5" y="-474.8" font-family="Times,serif" font-size="14.00">执行 NOHZ Load Balance</text>
</g>
<!-- run_rebalance_domains -->
<g id="node1" class="node">
<title>run_rebalance_domains</title>
<ellipse fill="none" stroke="black" cx="666" cy="-441" rx="120.48" ry="18"/>
<text text-anchor="middle" x="666" y="-437.3" font-family="Times,serif" font-size="14.00">run_rebalance_domains</text>
</g>
<!-- update_blocked_averages -->
<g id="node2" class="node">
<title>update_blocked_averages</title>
<ellipse fill="none" stroke="black" cx="778" cy="-34" rx="129.18" ry="18"/>
<text text-anchor="middle" x="778" y="-30.3" font-family="Times,serif" font-size="14.00">update_blocked_averages</text>
</g>
<!-- run_rebalance_domains&#45;&gt;update_blocked_averages -->
<g id="edge1" class="edge">
<title>run_rebalance_domains&#45;&gt;update_blocked_averages</title>
<path fill="none" stroke="black" stroke-dasharray="5,2" d="M613.46,-424.8C581.58,-412 547,-390.04 547,-355 547,-355 547,-355 547,-120 547,-88.24 624.86,-64.71 690.17,-50.56"/>
<polygon fill="black" stroke="black" points="691.06,-53.95 700.12,-48.45 689.61,-47.1 691.06,-53.95"/>
</g>
<!-- rebalance_domains -->
<g id="node3" class="node">
<title>rebalance_domains</title>
<ellipse fill="palegreen" stroke="black" cx="665" cy="-121" rx="99.38" ry="18"/>
<text text-anchor="middle" x="665" y="-117.3" font-family="Times,serif" font-size="14.00">rebalance_domains</text>
</g>
<!-- run_rebalance_domains&#45;&gt;rebalance_domains -->
<g id="edge2" class="edge">
<title>run_rebalance_domains&#45;&gt;rebalance_domains</title>
<path fill="none" stroke="black" stroke-dasharray="5,2" d="M625.45,-424.02C598.11,-410.28 567,-387.51 567,-355 567,-355 567,-355 567,-207 567,-177.91 591.94,-156.54 616.65,-142.51"/>
<polygon fill="black" stroke="black" points="618.54,-145.47 625.7,-137.66 615.24,-139.3 618.54,-145.47"/>
</g>
<!-- nohz_idle_balance -->
<g id="node15" class="node">
<title>nohz_idle_balance</title>
<ellipse fill="palegreen" stroke="black" cx="743" cy="-354" rx="94.48" ry="18"/>
<text text-anchor="middle" x="743" y="-350.3" font-family="Times,serif" font-size="14.00">nohz_idle_balance</text>
</g>
<!-- run_rebalance_domains&#45;&gt;nohz_idle_balance -->
<g id="edge17" class="edge">
<title>run_rebalance_domains&#45;&gt;nohz_idle_balance</title>
<path fill="none" stroke="black" d="M681.58,-422.8C692.82,-410.39 708.16,-393.46 720.7,-379.62"/>
<polygon fill="black" stroke="black" points="723.58,-381.65 727.7,-371.89 718.4,-376.95 723.58,-381.65"/>
<text text-anchor="middle" x="808.5" y="-393.8" font-family="Times,serif" font-size="14.00">has NOHZ_BALANCE_KICK</text>
</g>
<!-- scheduler_tick -->
<g id="node4" class="node">
<title>scheduler_tick</title>
<ellipse fill="none" stroke="black" cx="694" cy="-1119" rx="77.19" ry="18"/>
<text text-anchor="middle" x="694" y="-1115.3" font-family="Times,serif" font-size="14.00">scheduler_tick</text>
</g>
<!-- trigger_load_balance -->
<g id="node5" class="node">
<title>trigger_load_balance</title>
<ellipse fill="none" stroke="black" cx="694" cy="-1046" rx="107.48" ry="18"/>
<text text-anchor="middle" x="694" y="-1042.3" font-family="Times,serif" font-size="14.00">trigger_load_balance</text>
</g>
<!-- scheduler_tick&#45;&gt;trigger_load_balance -->
<g id="edge3" class="edge">
<title>scheduler_tick&#45;&gt;trigger_load_balance</title>
<path fill="none" stroke="black" d="M694,-1100.81C694,-1092.79 694,-1083.05 694,-1074.07"/>
<polygon fill="black" stroke="black" points="697.5,-1074.03 694,-1064.03 690.5,-1074.03 697.5,-1074.03"/>
</g>
<!-- nohz_balancer_kick -->
<g id="node6" class="node">
<title>nohz_balancer_kick</title>
<ellipse fill="none" stroke="black" cx="518" cy="-973" rx="100.18" ry="18"/>
<text text-anchor="middle" x="518" y="-969.3" font-family="Times,serif" font-size="14.00">nohz_balancer_kick</text>
</g>
<!-- trigger_load_balance&#45;&gt;nohz_balancer_kick -->
<g id="edge4" class="edge">
<title>trigger_load_balance&#45;&gt;nohz_balancer_kick</title>
<path fill="none" stroke="black" d="M654.5,-1029.07C628.39,-1018.53 594,-1004.66 566.27,-993.47"/>
<polygon fill="black" stroke="black" points="567.34,-990.13 556.76,-989.64 564.72,-996.62 567.34,-990.13"/>
</g>
<!-- raise_softirq_SCHED_SOFTIRQ -->
<g id="node7" class="node">
<title>raise_softirq_SCHED_SOFTIRQ</title>
<ellipse fill="lightgrey" stroke="black" cx="666" cy="-535" rx="158.67" ry="18"/>
<text text-anchor="middle" x="666" y="-531.3" font-family="Times,serif" font-size="14.00">raise_softirq(SCHED_SOFTIRQ)</text>
</g>
<!-- trigger_load_balance&#45;&gt;raise_softirq_SCHED_SOFTIRQ -->
<g id="edge5" class="edge">
<title>trigger_load_balance&#45;&gt;raise_softirq_SCHED_SOFTIRQ</title>
<path fill="none" stroke="black" stroke-dasharray="5,2" d="M765.63,-1032.46C796.22,-1022.58 825,-1005.04 825,-974 825,-974 825,-974 825,-607 825,-579.42 804.8,-562.48 778.8,-552.1"/>
<polygon fill="black" stroke="black" points="779.98,-548.8 769.39,-548.69 777.6,-555.38 779.98,-548.8"/>
</g>
<!-- set_NOHZ_STATS_KICK -->
<g id="node8" class="node">
<title>set_NOHZ_STATS_KICK</title>
<ellipse fill="none" stroke="black" cx="137" cy="-900" rx="120.78" ry="18"/>
<text text-anchor="middle" x="137" y="-896.3" font-family="Times,serif" font-size="14.00">set_NOHZ_STATS_KICK</text>
</g>
<!-- nohz_balancer_kick&#45;&gt;set_NOHZ_STATS_KICK -->
<g id="edge6" class="edge">
<title>nohz_balancer_kick&#45;&gt;set_NOHZ_STATS_KICK</title>
<path fill="none" stroke="black" d="M451.2,-959.55C386.62,-947.52 288.61,-929.25 219.26,-916.33"/>
<polygon fill="black" stroke="black" points="219.71,-912.85 209.24,-914.46 218.43,-919.74 219.71,-912.85"/>
</g>
<!-- set_NOHZ_BALANCE_KICK -->
<g id="node9" class="node">
<title>set_NOHZ_BALANCE_KICK</title>
<ellipse fill="none" stroke="black" cx="414" cy="-900" rx="137.58" ry="18"/>
<text text-anchor="middle" x="414" y="-896.3" font-family="Times,serif" font-size="14.00">set_NOHZ_BALANCE_KICK</text>
</g>
<!-- nohz_balancer_kick&#45;&gt;set_NOHZ_BALANCE_KICK -->
<g id="edge7" class="edge">
<title>nohz_balancer_kick&#45;&gt;set_NOHZ_BALANCE_KICK</title>
<path fill="none" stroke="black" d="M493.62,-955.35C479.76,-945.9 462.23,-933.93 447.14,-923.63"/>
<polygon fill="black" stroke="black" points="448.82,-920.54 438.59,-917.79 444.88,-926.32 448.82,-920.54"/>
</g>
<!-- set_NOHZ_NEXT_KICK -->
<g id="node10" class="node">
<title>set_NOHZ_NEXT_KICK</title>
<ellipse fill="none" stroke="black" cx="688" cy="-900" rx="118.08" ry="18"/>
<text text-anchor="middle" x="688" y="-896.3" font-family="Times,serif" font-size="14.00">set_NOHZ_NEXT_KICK</text>
</g>
<!-- nohz_balancer_kick&#45;&gt;set_NOHZ_NEXT_KICK -->
<g id="edge8" class="edge">
<title>nohz_balancer_kick&#45;&gt;set_NOHZ_NEXT_KICK</title>
<path fill="none" stroke="black" d="M555.73,-956.24C580.56,-945.87 613.28,-932.21 639.96,-921.06"/>
<polygon fill="black" stroke="black" points="641.62,-924.17 649.49,-917.08 638.92,-917.71 641.62,-924.17"/>
</g>
<!-- raise_softirq_SCHED_SOFTIRQ&#45;&gt;run_rebalance_domains -->
<g id="edge16" class="edge">
<title>raise_softirq_SCHED_SOFTIRQ&#45;&gt;run_rebalance_domains</title>
<path fill="none" stroke="black" stroke-dasharray="5,2" d="M666,-516.7C666,-503.46 666,-484.95 666,-469.66"/>
<polygon fill="black" stroke="black" points="669.5,-469.23 666,-459.23 662.5,-469.23 669.5,-469.23"/>
</g>
<!-- kick_ilb -->
<g id="node11" class="node">
<title>kick_ilb</title>
<ellipse fill="none" stroke="black" cx="417" cy="-827" rx="45.49" ry="18"/>
<text text-anchor="middle" x="417" y="-823.3" font-family="Times,serif" font-size="14.00">kick_ilb</text>
</g>
<!-- set_NOHZ_STATS_KICK&#45;&gt;kick_ilb -->
<g id="edge9" class="edge">
<title>set_NOHZ_STATS_KICK&#45;&gt;kick_ilb</title>
<path fill="none" stroke="black" d="M195.36,-884.2C247.13,-871.07 321.8,-852.14 369.86,-839.95"/>
<polygon fill="black" stroke="black" points="370.87,-843.31 379.7,-837.46 369.15,-836.52 370.87,-843.31"/>
</g>
<!-- set_NOHZ_BALANCE_KICK&#45;&gt;kick_ilb -->
<g id="edge10" class="edge">
<title>set_NOHZ_BALANCE_KICK&#45;&gt;kick_ilb</title>
<path fill="none" stroke="black" d="M414.73,-881.81C415.07,-873.79 415.48,-864.05 415.86,-855.07"/>
<polygon fill="black" stroke="black" points="419.36,-855.17 416.28,-845.03 412.36,-854.87 419.36,-855.17"/>
</g>
<!-- set_NOHZ_NEXT_KICK&#45;&gt;kick_ilb -->
<g id="edge11" class="edge">
<title>set_NOHZ_NEXT_KICK&#45;&gt;kick_ilb</title>
<path fill="none" stroke="black" d="M631.19,-884.12C581.45,-871.08 510.06,-852.38 463.61,-840.21"/>
<polygon fill="black" stroke="black" points="464.36,-836.79 453.8,-837.64 462.59,-843.56 464.36,-836.79"/>
</g>
<!-- find_new_ilb -->
<g id="node12" class="node">
<title>find_new_ilb</title>
<ellipse fill="none" stroke="black" cx="449" cy="-754" rx="67.69" ry="18"/>
<text text-anchor="middle" x="449" y="-750.3" font-family="Times,serif" font-size="14.00">find_new_ilb</text>
</g>
<!-- kick_ilb&#45;&gt;find_new_ilb -->
<g id="edge12" class="edge">
<title>kick_ilb&#45;&gt;find_new_ilb</title>
<path fill="none" stroke="black" d="M424.58,-809.17C428.31,-800.9 432.9,-790.72 437.08,-781.44"/>
<polygon fill="black" stroke="black" points="440.33,-782.75 441.25,-772.2 433.95,-779.88 440.33,-782.75"/>
</g>
<!-- KICK_CPU_BY_IPI -->
<g id="node13" class="node">
<title>KICK_CPU_BY_IPI</title>
<ellipse fill="palegreen" stroke="black" cx="456" cy="-681" rx="332.54" ry="18"/>
<text text-anchor="middle" x="456" y="-677.3" font-family="Times,serif" font-size="14.00">smp_call_function_single_async(ilb_cpu, &amp;cpu_rq(ilb_cpu)&#45;&gt;nohz_csd)</text>
</g>
<!-- find_new_ilb&#45;&gt;KICK_CPU_BY_IPI -->
<g id="edge13" class="edge">
<title>find_new_ilb&#45;&gt;KICK_CPU_BY_IPI</title>
<path fill="none" stroke="black" d="M450.69,-735.81C451.49,-727.79 452.45,-718.05 453.33,-709.07"/>
<polygon fill="black" stroke="black" points="456.82,-709.32 454.32,-699.03 449.86,-708.64 456.82,-709.32"/>
</g>
<!-- nohz_csd_func -->
<g id="node14" class="node">
<title>nohz_csd_func</title>
<ellipse fill="none" stroke="black" cx="582" cy="-608" rx="77.19" ry="18"/>
<text text-anchor="middle" x="582" y="-604.3" font-family="Times,serif" font-size="14.00">nohz_csd_func</text>
</g>
<!-- KICK_CPU_BY_IPI&#45;&gt;nohz_csd_func -->
<g id="edge14" class="edge">
<title>KICK_CPU_BY_IPI&#45;&gt;nohz_csd_func</title>
<path fill="none" stroke="black" d="M486.18,-662.99C503.82,-653.05 526.23,-640.42 544.94,-629.88"/>
<polygon fill="black" stroke="black" points="546.8,-632.85 553.79,-624.89 543.36,-626.75 546.8,-632.85"/>
</g>
<!-- nohz_csd_func&#45;&gt;raise_softirq_SCHED_SOFTIRQ -->
<g id="edge15" class="edge">
<title>nohz_csd_func&#45;&gt;raise_softirq_SCHED_SOFTIRQ</title>
<path fill="none" stroke="black" d="M601.48,-590.53C612.35,-581.35 626.08,-569.75 638.07,-559.61"/>
<polygon fill="black" stroke="black" points="640.66,-562 646.04,-552.87 636.14,-556.65 640.66,-562"/>
</g>
<!-- clear_nohz_idle_balance -->
<g id="node16" class="node">
<title>clear_nohz_idle_balance</title>
<ellipse fill="lightgrey" stroke="black" cx="743" cy="-281" rx="156.77" ry="18"/>
<text text-anchor="middle" x="743" y="-277.3" font-family="Times,serif" font-size="14.00">this_rq&#45;&gt;nohz_idle_balance = 0</text>
</g>
<!-- nohz_idle_balance&#45;&gt;clear_nohz_idle_balance -->
<g id="edge18" class="edge">
<title>nohz_idle_balance&#45;&gt;clear_nohz_idle_balance</title>
<path fill="none" stroke="black" d="M743,-335.81C743,-327.79 743,-318.05 743,-309.07"/>
<polygon fill="black" stroke="black" points="746.5,-309.03 743,-299.03 739.5,-309.03 746.5,-309.03"/>
</g>
<!-- _nohz_idle_balance -->
<g id="node17" class="node">
<title>_nohz_idle_balance</title>
<ellipse fill="none" stroke="black" cx="1016" cy="-281" rx="98.58" ry="18"/>
<text text-anchor="middle" x="1016" y="-277.3" font-family="Times,serif" font-size="14.00">_nohz_idle_balance</text>
</g>
<!-- nohz_idle_balance&#45;&gt;_nohz_idle_balance -->
<g id="edge19" class="edge">
<title>nohz_idle_balance&#45;&gt;_nohz_idle_balance</title>
<path fill="none" stroke="black" d="M796.29,-339.14C840.9,-327.54 904.71,-310.94 952.07,-298.63"/>
<polygon fill="black" stroke="black" points="953.12,-301.97 961.92,-296.07 951.36,-295.2 953.12,-301.97"/>
</g>
<!-- for_each_nohz_idle_cpus_mask -->
<g id="node18" class="node">
<title>for_each_nohz_idle_cpus_mask</title>
<ellipse fill="none" stroke="black" cx="885" cy="-208" rx="152.17" ry="18"/>
<text text-anchor="middle" x="885" y="-204.3" font-family="Times,serif" font-size="14.00">for_each_nohz_idle_cpus_mask</text>
</g>
<!-- _nohz_idle_balance&#45;&gt;for_each_nohz_idle_cpus_mask -->
<g id="edge20" class="edge">
<title>_nohz_idle_balance&#45;&gt;for_each_nohz_idle_cpus_mask</title>
<path fill="none" stroke="black" d="M985.95,-263.71C967.82,-253.89 944.5,-241.25 924.85,-230.6"/>
<polygon fill="black" stroke="black" points="926.28,-227.39 915.82,-225.71 922.95,-233.55 926.28,-227.39"/>
</g>
<!-- for_each_nohz_idle_cpus_mask&#45;&gt;rebalance_domains -->
<g id="edge23" class="edge">
<title>for_each_nohz_idle_cpus_mask&#45;&gt;rebalance_domains</title>
<path fill="none" stroke="black" d="M766.84,-196.64C730.6,-191.33 696.66,-183.47 683,-172 676.17,-166.26 671.93,-157.73 669.3,-149.33"/>
<polygon fill="black" stroke="black" points="672.63,-148.2 666.82,-139.34 665.83,-149.89 672.63,-148.2"/>
<text text-anchor="middle" x="781.5" y="-160.8" font-family="Times,serif" font-size="14.00">has NOHZ_BALANCE_KICK</text>
</g>
<!-- update_nohz_stats -->
<g id="node19" class="node">
<title>update_nohz_stats</title>
<ellipse fill="none" stroke="black" cx="882" cy="-121" rx="96.68" ry="18"/>
<text text-anchor="middle" x="882" y="-117.3" font-family="Times,serif" font-size="14.00">update_nohz_stats</text>
</g>
<!-- for_each_nohz_idle_cpus_mask&#45;&gt;update_nohz_stats -->
<g id="edge21" class="edge">
<title>for_each_nohz_idle_cpus_mask&#45;&gt;update_nohz_stats</title>
<path fill="none" stroke="black" d="M884.39,-189.8C883.98,-178.16 883.43,-162.55 882.96,-149.24"/>
<polygon fill="black" stroke="black" points="886.46,-149.05 882.61,-139.18 879.46,-149.29 886.46,-149.05"/>
<text text-anchor="middle" x="969.5" y="-160.8" font-family="Times,serif" font-size="14.00">has NOHZ_STATS_KICK</text>
</g>
<!-- update_nohz_stats&#45;&gt;update_blocked_averages -->
<g id="edge22" class="edge">
<title>update_nohz_stats&#45;&gt;update_blocked_averages</title>
<path fill="none" stroke="black" d="M861.45,-103.21C845.89,-90.48 824.3,-72.84 806.97,-58.68"/>
<polygon fill="black" stroke="black" points="808.82,-55.67 798.86,-52.05 804.39,-61.09 808.82,-55.67"/>
<text text-anchor="middle" x="922.5" y="-73.8" font-family="Times,serif" font-size="14.00">has NOHZ_STATS_KICK</text>
</g>
<!-- newidle_balance -->
<g id="node20" class="node">
<title>newidle_balance</title>
<ellipse fill="palegreen" stroke="black" cx="1109" cy="-1119" rx="87.18" ry="18"/>
<text text-anchor="middle" x="1109" y="-1115.3" font-family="Times,serif" font-size="14.00">newidle_balance</text>
</g>
<!-- nohz_newidle_balance -->
<g id="node21" class="node">
<title>nohz_newidle_balance</title>
<ellipse fill="none" stroke="black" cx="1109" cy="-1046" rx="113.18" ry="18"/>
<text text-anchor="middle" x="1109" y="-1042.3" font-family="Times,serif" font-size="14.00">nohz_newidle_balance</text>
</g>
<!-- newidle_balance&#45;&gt;nohz_newidle_balance -->
<g id="edge24" class="edge">
<title>newidle_balance&#45;&gt;nohz_newidle_balance</title>
<path fill="none" stroke="black" d="M1109,-1100.81C1109,-1092.79 1109,-1083.05 1109,-1074.07"/>
<polygon fill="black" stroke="black" points="1112.5,-1074.03 1109,-1064.03 1105.5,-1074.03 1112.5,-1074.03"/>
</g>
<!-- set_NOHZ_NEWILB_KICK -->
<g id="node22" class="node">
<title>set_NOHZ_NEWILB_KICK</title>
<ellipse fill="palegreen" stroke="black" cx="1109" cy="-973" rx="264.55" ry="18"/>
<text text-anchor="middle" x="1109" y="-969.3" font-family="Times,serif" font-size="14.00">atomic_or(NOHZ_NEWILB_KICK, nohz_flags(this_cpu))</text>
</g>
<!-- nohz_newidle_balance&#45;&gt;set_NOHZ_NEWILB_KICK -->
<g id="edge25" class="edge">
<title>nohz_newidle_balance&#45;&gt;set_NOHZ_NEWILB_KICK</title>
<path fill="none" stroke="black" d="M1109,-1027.81C1109,-1019.79 1109,-1010.05 1109,-1001.07"/>
<polygon fill="black" stroke="black" points="1112.5,-1001.03 1109,-991.03 1105.5,-1001.03 1112.5,-1001.03"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 17 KiB

@@ -0,0 +1,47 @@
digraph load_balance {
subgraph cluster_0 {
label = "触发选核(被动负载均衡)";
color = red;
wake_up_new_task -> select_task_rq [label="WF_TTWU"];
sched_exec -> select_task_rq [label="WF_EXEC"];
try_to_wake_up -> select_task_rq [label="WF_TTWU"];
select_task_rq -> select_task_rq_fair [style=dashed];
};
select_task_rq_fair -> find_energy_efficient_cpu [label="WF_TTWU && sched_energy_enabled"];
select_task_rq_fair -> select_idle_sibling [label="want_affine && SD_WAKE_AFFINE && WF_TTWU"];
select_task_rq_fair -> find_idlest_cpu;
subgraph cluster_1 {
label = "唤醒路径的能效感知";
color = blue;
find_energy_efficient_cpu -> compute_energy;
};
subgraph cluster_2 {
label = "慢速路径";
color = blue;
find_idlest_cpu -> {find_idlest_group, find_idlest_group_cpu};
};
subgraph cluster_3 {
label = "唤醒快速路径";
color = blue;
select_idle_sibling -> {select_idle_capacity, select_idle_smt, select_idle_cpu};
};
wake_up_new_task [label="wake_up_new_task"; style=filled; fillcolor=lightyellow; shape=oval];
sched_exec [label="sched_exec"; style=filled; fillcolor=lightyellow; shape=oval];
try_to_wake_up [label="try_to_wake_up"; style=filled; fillcolor=lightyellow; shape=oval];
select_task_rq_fair [label="select_task_rq_fair"; style=filled; fillcolor=palegreen; shape=oval];
find_energy_efficient_cpu [label="find_energy_efficient_cpu"; style=filled; fillcolor=lightyellow; shape=oval];
select_idle_sibling [label="select_idle_sibling"; style=filled; fillcolor=lightyellow; shape=oval];
find_idlest_cpu [label="find_idlest_cpu"; style=filled; fillcolor=lightyellow; shape=oval];
}
@@ -0,0 +1,200 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.43.0 (0)
-->
<!-- Title: load_balance Pages: 1 -->
<svg width="1331pt" height="440pt"
viewBox="0.00 0.00 1331.00 440.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 436)">
<title>load_balance</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-436 1327,-436 1327,4 -4,4"/>
<g id="clust1" class="cluster">
<title>cluster_0</title>
<polygon fill="none" stroke="red" points="344,-189 344,-424 884,-424 884,-189 344,-189"/>
<text text-anchor="middle" x="614" y="-408.8" font-family="Times,serif" font-size="14.00">触发选核(被动负载均衡)</text>
</g>
<g id="clust2" class="cluster">
<title>cluster_1</title>
<polygon fill="none" stroke="blue" points="8,-8 8,-156 280,-156 280,-8 8,-8"/>
<text text-anchor="middle" x="144" y="-140.8" font-family="Times,serif" font-size="14.00">唤醒路径的能效感知</text>
</g>
<g id="clust3" class="cluster">
<title>cluster_2</title>
<polygon fill="none" stroke="blue" points="879,-8 879,-156 1315,-156 1315,-8 879,-8"/>
<text text-anchor="middle" x="1097" y="-140.8" font-family="Times,serif" font-size="14.00">慢速路径</text>
</g>
<g id="clust5" class="cluster">
<title>cluster_3</title>
<polygon fill="none" stroke="blue" points="288,-8 288,-156 870,-156 870,-8 288,-8"/>
<text text-anchor="middle" x="579" y="-140.8" font-family="Times,serif" font-size="14.00">唤醒快速路径</text>
</g>
<!-- wake_up_new_task -->
<g id="node1" class="node">
<title>wake_up_new_task</title>
<ellipse fill="lightyellow" stroke="black" cx="778" cy="-375" rx="98.28" ry="18"/>
<text text-anchor="middle" x="778" y="-371.3" font-family="Times,serif" font-size="14.00">wake_up_new_task</text>
</g>
<!-- select_task_rq -->
<g id="node2" class="node">
<title>select_task_rq</title>
<ellipse fill="none" stroke="black" cx="599" cy="-288" rx="76.89" ry="18"/>
<text text-anchor="middle" x="599" y="-284.3" font-family="Times,serif" font-size="14.00">select_task_rq</text>
</g>
<!-- wake_up_new_task&#45;&gt;select_task_rq -->
<g id="edge1" class="edge">
<title>wake_up_new_task&#45;&gt;select_task_rq</title>
<path fill="none" stroke="black" d="M745.5,-357.77C725.52,-347.87 699.36,-335.03 676,-324 665.22,-318.91 653.53,-313.52 642.59,-308.55"/>
<polygon fill="black" stroke="black" points="643.77,-305.24 633.21,-304.29 640.87,-311.61 643.77,-305.24"/>
<text text-anchor="middle" x="745" y="-327.8" font-family="Times,serif" font-size="14.00">WF_TTWU</text>
</g>
<!-- select_task_rq_fair -->
<g id="node5" class="node">
<title>select_task_rq_fair</title>
<ellipse fill="palegreen" stroke="black" cx="599" cy="-215" rx="96.68" ry="18"/>
<text text-anchor="middle" x="599" y="-211.3" font-family="Times,serif" font-size="14.00">select_task_rq_fair</text>
</g>
<!-- select_task_rq&#45;&gt;select_task_rq_fair -->
<g id="edge4" class="edge">
<title>select_task_rq&#45;&gt;select_task_rq_fair</title>
<path fill="none" stroke="black" stroke-dasharray="5,2" d="M599,-269.81C599,-261.79 599,-252.05 599,-243.07"/>
<polygon fill="black" stroke="black" points="602.5,-243.03 599,-233.03 595.5,-243.03 602.5,-243.03"/>
</g>
<!-- sched_exec -->
<g id="node3" class="node">
<title>sched_exec</title>
<ellipse fill="lightyellow" stroke="black" cx="599" cy="-375" rx="63.09" ry="18"/>
<text text-anchor="middle" x="599" y="-371.3" font-family="Times,serif" font-size="14.00">sched_exec</text>
</g>
<!-- sched_exec&#45;&gt;select_task_rq -->
<g id="edge2" class="edge">
<title>sched_exec&#45;&gt;select_task_rq</title>
<path fill="none" stroke="black" d="M599,-356.8C599,-345.16 599,-329.55 599,-316.24"/>
<polygon fill="black" stroke="black" points="602.5,-316.18 599,-306.18 595.5,-316.18 602.5,-316.18"/>
<text text-anchor="middle" x="635.5" y="-327.8" font-family="Times,serif" font-size="14.00">WF_EXEC</text>
</g>
<!-- try_to_wake_up -->
<g id="node4" class="node">
<title>try_to_wake_up</title>
<ellipse fill="lightyellow" stroke="black" cx="435" cy="-375" rx="82.59" ry="18"/>
<text text-anchor="middle" x="435" y="-371.3" font-family="Times,serif" font-size="14.00">try_to_wake_up</text>
</g>
<!-- try_to_wake_up&#45;&gt;select_task_rq -->
<g id="edge3" class="edge">
<title>try_to_wake_up&#45;&gt;select_task_rq</title>
<path fill="none" stroke="black" d="M460.27,-357.84C476.71,-347.61 498.77,-334.39 519,-324 529.85,-318.42 541.78,-312.9 553.05,-307.94"/>
<polygon fill="black" stroke="black" points="554.53,-311.11 562.31,-303.91 551.75,-304.69 554.53,-311.11"/>
<text text-anchor="middle" x="557" y="-327.8" font-family="Times,serif" font-size="14.00">WF_TTWU</text>
</g>
<!-- find_energy_efficient_cpu -->
<g id="node6" class="node">
<title>find_energy_efficient_cpu</title>
<ellipse fill="lightyellow" stroke="black" cx="144" cy="-107" rx="128.08" ry="18"/>
<text text-anchor="middle" x="144" y="-103.3" font-family="Times,serif" font-size="14.00">find_energy_efficient_cpu</text>
</g>
<!-- select_task_rq_fair&#45;&gt;find_energy_efficient_cpu -->
<g id="edge5" class="edge">
<title>select_task_rq_fair&#45;&gt;find_energy_efficient_cpu</title>
<path fill="none" stroke="black" d="M509.08,-208.24C454.84,-203.37 384.72,-194.58 324,-179 275.76,-166.62 223.03,-144.77 187.18,-128.57"/>
<polygon fill="black" stroke="black" points="188.54,-125.34 177.99,-124.37 185.63,-131.71 188.54,-125.34"/>
<text text-anchor="middle" x="459.5" y="-167.8" font-family="Times,serif" font-size="14.00">WF_TTWU &amp;&amp; sched_energy_enabled</text>
</g>
<!-- select_idle_sibling -->
<g id="node7" class="node">
<title>select_idle_sibling</title>
<ellipse fill="lightyellow" stroke="black" cx="599" cy="-107" rx="94.78" ry="18"/>
<text text-anchor="middle" x="599" y="-103.3" font-family="Times,serif" font-size="14.00">select_idle_sibling</text>
</g>
<!-- select_task_rq_fair&#45;&gt;select_idle_sibling -->
<g id="edge6" class="edge">
<title>select_task_rq_fair&#45;&gt;select_idle_sibling</title>
<path fill="none" stroke="black" d="M599,-196.97C599,-180.38 599,-154.88 599,-135.43"/>
<polygon fill="black" stroke="black" points="602.5,-135.34 599,-125.34 595.5,-135.34 602.5,-135.34"/>
<text text-anchor="middle" x="780.5" y="-167.8" font-family="Times,serif" font-size="14.00">want_affine &amp;&amp; SD_WAKE_AFFINE &amp;&amp; WF_TTWU</text>
</g>
<!-- find_idlest_cpu -->
<g id="node8" class="node">
<title>find_idlest_cpu</title>
<ellipse fill="lightyellow" stroke="black" cx="977" cy="-107" rx="79.09" ry="18"/>
<text text-anchor="middle" x="977" y="-103.3" font-family="Times,serif" font-size="14.00">find_idlest_cpu</text>
</g>
<!-- select_task_rq_fair&#45;&gt;find_idlest_cpu -->
<g id="edge7" class="edge">
<title>select_task_rq_fair&#45;&gt;find_idlest_cpu</title>
<path fill="none" stroke="black" d="M693.27,-210.7C794.44,-206.27 943.36,-196.79 963,-179 974.91,-168.21 978.42,-150.47 978.94,-135.42"/>
<polygon fill="black" stroke="black" points="982.44,-135.06 978.87,-125.08 975.44,-135.1 982.44,-135.06"/>
</g>
<!-- compute_energy -->
<g id="node9" class="node">
<title>compute_energy</title>
<ellipse fill="none" stroke="black" cx="144" cy="-34" rx="87.18" ry="18"/>
<text text-anchor="middle" x="144" y="-30.3" font-family="Times,serif" font-size="14.00">compute_energy</text>
</g>
<!-- find_energy_efficient_cpu&#45;&gt;compute_energy -->
<g id="edge8" class="edge">
<title>find_energy_efficient_cpu&#45;&gt;compute_energy</title>
<path fill="none" stroke="black" d="M144,-88.81C144,-80.79 144,-71.05 144,-62.07"/>
<polygon fill="black" stroke="black" points="147.5,-62.03 144,-52.03 140.5,-62.03 147.5,-62.03"/>
</g>
<!-- select_idle_capacity -->
<g id="node12" class="node">
<title>select_idle_capacity</title>
<ellipse fill="none" stroke="black" cx="399" cy="-34" rx="102.88" ry="18"/>
<text text-anchor="middle" x="399" y="-30.3" font-family="Times,serif" font-size="14.00">select_idle_capacity</text>
</g>
<!-- select_idle_sibling&#45;&gt;select_idle_capacity -->
<g id="edge11" class="edge">
<title>select_idle_sibling&#45;&gt;select_idle_capacity</title>
<path fill="none" stroke="black" d="M556.09,-90.77C525.72,-79.99 484.78,-65.45 452.31,-53.92"/>
<polygon fill="black" stroke="black" points="453.12,-50.5 442.52,-50.45 450.78,-57.09 453.12,-50.5"/>
</g>
<!-- select_idle_smt -->
<g id="node13" class="node">
<title>select_idle_smt</title>
<ellipse fill="none" stroke="black" cx="601" cy="-34" rx="81.49" ry="18"/>
<text text-anchor="middle" x="601" y="-30.3" font-family="Times,serif" font-size="14.00">select_idle_smt</text>
</g>
<!-- select_idle_sibling&#45;&gt;select_idle_smt -->
<g id="edge12" class="edge">
<title>select_idle_sibling&#45;&gt;select_idle_smt</title>
<path fill="none" stroke="black" d="M599.48,-88.81C599.71,-80.79 599.98,-71.05 600.24,-62.07"/>
<polygon fill="black" stroke="black" points="603.74,-62.12 600.52,-52.03 596.74,-61.93 603.74,-62.12"/>
</g>
<!-- select_idle_cpu -->
<g id="node14" class="node">
<title>select_idle_cpu</title>
<ellipse fill="none" stroke="black" cx="781" cy="-34" rx="80.69" ry="18"/>
<text text-anchor="middle" x="781" y="-30.3" font-family="Times,serif" font-size="14.00">select_idle_cpu</text>
</g>
<!-- select_idle_sibling&#45;&gt;select_idle_cpu -->
<g id="edge13" class="edge">
<title>select_idle_sibling&#45;&gt;select_idle_cpu</title>
<path fill="none" stroke="black" d="M638.49,-90.59C666.29,-79.75 703.66,-65.17 733.16,-53.66"/>
<polygon fill="black" stroke="black" points="734.79,-56.78 742.83,-49.89 732.24,-50.26 734.79,-56.78"/>
</g>
<!-- find_idlest_group -->
<g id="node10" class="node">
<title>find_idlest_group</title>
<ellipse fill="none" stroke="black" cx="977" cy="-34" rx="90.18" ry="18"/>
<text text-anchor="middle" x="977" y="-30.3" font-family="Times,serif" font-size="14.00">find_idlest_group</text>
</g>
<!-- find_idlest_cpu&#45;&gt;find_idlest_group -->
<g id="edge9" class="edge">
<title>find_idlest_cpu&#45;&gt;find_idlest_group</title>
<path fill="none" stroke="black" d="M977,-88.81C977,-80.79 977,-71.05 977,-62.07"/>
<polygon fill="black" stroke="black" points="980.5,-62.03 977,-52.03 973.5,-62.03 980.5,-62.03"/>
</g>
<!-- find_idlest_group_cpu -->
<g id="node11" class="node">
<title>find_idlest_group_cpu</title>
<ellipse fill="none" stroke="black" cx="1196" cy="-34" rx="111.28" ry="18"/>
<text text-anchor="middle" x="1196" y="-30.3" font-family="Times,serif" font-size="14.00">find_idlest_group_cpu</text>
</g>
<!-- find_idlest_cpu&#45;&gt;find_idlest_group_cpu -->
<g id="edge10" class="edge">
<title>find_idlest_cpu&#45;&gt;find_idlest_group_cpu</title>
<path fill="none" stroke="black" d="M1020.53,-91.89C1054.54,-80.86 1102.08,-65.45 1139.1,-53.45"/>
<polygon fill="black" stroke="black" points="1140.33,-56.73 1148.76,-50.32 1138.17,-50.07 1140.33,-56.73"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

@@ -1,11 +1,21 @@
digraph rebalance_domains {
// 周期性负载均衡器 run_rebalance_domains
scheduler_tick -> trigger_load_balance -> {raise_softirq_SCHED_SOFTIRQ, nohz_balancer_kick};
raise_softirq_SCHED_SOFTIRQ -> run_rebalance_domains [style=dashed];
run_rebalance_domains -> {nohz_idle_balance, update_blocked_averages, rebalance_domains};
subgraph cluster_1 {
label = "触发 Periodic Load Balance";
color=red;
rebalance_domains -> for_each_domain_LB -> {update_newidle_cost, get_sd_balance_interval, load_balance, update_next_balance};
scheduler_tick -> trigger_load_balance -> {raise_softirq_SCHED_SOFTIRQ, nohz_balancer_kick};
raise_softirq_SCHED_SOFTIRQ -> run_rebalance_domains [style=dashed];
run_rebalance_domains -> {nohz_idle_balance, update_blocked_averages, rebalance_domains};
};
subgraph cluster_2 {
label = "执行 Periodic Load Balance";
color=blue;
rebalance_domains -> for_each_domain_LB -> {update_newidle_cost, get_sd_balance_interval, load_balance, update_next_balance};
};
// caller
raise_softirq_SCHED_SOFTIRQ [label="raise_softirq(SCHED_SOFTIRQ)"; style=filled; fillcolor=lightyellow; shape=oval];
@@ -0,0 +1,173 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.43.0 (0)
-->
<!-- Title: rebalance_domains Pages: 1 -->
<svg width="1032pt" height="542pt"
viewBox="0.00 0.00 1032.00 542.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 538)">
<title>rebalance_domains</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-538 1028,-538 1028,4 -4,4"/>
<g id="clust1" class="cluster">
<title>cluster_1</title>
<polygon fill="none" stroke="red" points="8,-163 8,-526 706,-526 706,-163 8,-163"/>
<text text-anchor="middle" x="357" y="-510.8" font-family="Times,serif" font-size="14.00">触发 Periodic Load Balance</text>
</g>
<g id="clust4" class="cluster">
<title>cluster_2</title>
<polygon fill="none" stroke="blue" points="133,-8 133,-155 1016,-155 1016,-8 133,-8"/>
<text text-anchor="middle" x="574.5" y="-139.8" font-family="Times,serif" font-size="14.00">执行 Periodic Load Balance</text>
</g>
<!-- scheduler_tick -->
<g id="node1" class="node">
<title>scheduler_tick</title>
<ellipse fill="none" stroke="black" cx="456" cy="-477" rx="77.19" ry="18"/>
<text text-anchor="middle" x="456" y="-473.3" font-family="Times,serif" font-size="14.00">scheduler_tick</text>
</g>
<!-- trigger_load_balance -->
<g id="node2" class="node">
<title>trigger_load_balance</title>
<ellipse fill="none" stroke="black" cx="456" cy="-405" rx="107.48" ry="18"/>
<text text-anchor="middle" x="456" y="-401.3" font-family="Times,serif" font-size="14.00">trigger_load_balance</text>
</g>
<!-- scheduler_tick&#45;&gt;trigger_load_balance -->
<g id="edge1" class="edge">
<title>scheduler_tick&#45;&gt;trigger_load_balance</title>
<path fill="none" stroke="black" d="M456,-458.7C456,-450.98 456,-441.71 456,-433.11"/>
<polygon fill="black" stroke="black" points="459.5,-433.1 456,-423.1 452.5,-433.1 459.5,-433.1"/>
</g>
<!-- raise_softirq_SCHED_SOFTIRQ -->
<g id="node3" class="node">
<title>raise_softirq_SCHED_SOFTIRQ</title>
<ellipse fill="lightyellow" stroke="black" cx="321" cy="-333" rx="158.67" ry="18"/>
<text text-anchor="middle" x="321" y="-329.3" font-family="Times,serif" font-size="14.00">raise_softirq(SCHED_SOFTIRQ)</text>
</g>
<!-- trigger_load_balance&#45;&gt;raise_softirq_SCHED_SOFTIRQ -->
<g id="edge2" class="edge">
<title>trigger_load_balance&#45;&gt;raise_softirq_SCHED_SOFTIRQ</title>
<path fill="none" stroke="black" d="M424.69,-387.76C406.05,-378.1 382.17,-365.72 362.04,-355.28"/>
<polygon fill="black" stroke="black" points="363.57,-352.13 353.08,-350.63 360.35,-358.34 363.57,-352.13"/>
</g>
<!-- nohz_balancer_kick -->
<g id="node4" class="node">
<title>nohz_balancer_kick</title>
<ellipse fill="none" stroke="black" cx="598" cy="-333" rx="100.18" ry="18"/>
<text text-anchor="middle" x="598" y="-329.3" font-family="Times,serif" font-size="14.00">nohz_balancer_kick</text>
</g>
<!-- trigger_load_balance&#45;&gt;nohz_balancer_kick -->
<g id="edge3" class="edge">
<title>trigger_load_balance&#45;&gt;nohz_balancer_kick</title>
<path fill="none" stroke="black" d="M488.93,-387.76C508.92,-377.91 534.61,-365.25 556.04,-354.68"/>
<polygon fill="black" stroke="black" points="557.82,-357.71 565.24,-350.15 554.73,-351.43 557.82,-357.71"/>
</g>
<!-- run_rebalance_domains -->
<g id="node5" class="node">
<title>run_rebalance_domains</title>
<ellipse fill="none" stroke="black" cx="336" cy="-261" rx="120.48" ry="18"/>
<text text-anchor="middle" x="336" y="-257.3" font-family="Times,serif" font-size="14.00">run_rebalance_domains</text>
</g>
<!-- raise_softirq_SCHED_SOFTIRQ&#45;&gt;run_rebalance_domains -->
<g id="edge4" class="edge">
<title>raise_softirq_SCHED_SOFTIRQ&#45;&gt;run_rebalance_domains</title>
<path fill="none" stroke="black" stroke-dasharray="5,2" d="M324.71,-314.7C326.36,-306.98 328.35,-297.71 330.19,-289.11"/>
<polygon fill="black" stroke="black" points="333.66,-289.62 332.33,-279.1 326.82,-288.15 333.66,-289.62"/>
</g>
<!-- nohz_idle_balance -->
<g id="node6" class="node">
<title>nohz_idle_balance</title>
<ellipse fill="none" stroke="black" cx="110" cy="-189" rx="94.48" ry="18"/>
<text text-anchor="middle" x="110" y="-185.3" font-family="Times,serif" font-size="14.00">nohz_idle_balance</text>
</g>
<!-- run_rebalance_domains&#45;&gt;nohz_idle_balance -->
<g id="edge5" class="edge">
<title>run_rebalance_domains&#45;&gt;nohz_idle_balance</title>
<path fill="none" stroke="black" d="M286.12,-244.55C250.92,-233.65 203.69,-219.02 167,-207.65"/>
<polygon fill="black" stroke="black" points="168.02,-204.31 157.43,-204.69 165.95,-210.99 168.02,-204.31"/>
</g>
<!-- update_blocked_averages -->
<g id="node7" class="node">
<title>update_blocked_averages</title>
<ellipse fill="none" stroke="black" cx="352" cy="-189" rx="129.18" ry="18"/>
<text text-anchor="middle" x="352" y="-185.3" font-family="Times,serif" font-size="14.00">update_blocked_averages</text>
</g>
<!-- run_rebalance_domains&#45;&gt;update_blocked_averages -->
<g id="edge6" class="edge">
<title>run_rebalance_domains&#45;&gt;update_blocked_averages</title>
<path fill="none" stroke="black" d="M339.96,-242.7C341.72,-234.98 343.84,-225.71 345.8,-217.11"/>
<polygon fill="black" stroke="black" points="349.27,-217.63 348.09,-207.1 342.45,-216.07 349.27,-217.63"/>
</g>
<!-- rebalance_domains -->
<g id="node8" class="node">
<title>rebalance_domains</title>
<ellipse fill="palegreen" stroke="black" cx="599" cy="-189" rx="99.38" ry="18"/>
<text text-anchor="middle" x="599" y="-185.3" font-family="Times,serif" font-size="14.00">rebalance_domains</text>
</g>
<!-- run_rebalance_domains&#45;&gt;rebalance_domains -->
<g id="edge7" class="edge">
<title>run_rebalance_domains&#45;&gt;rebalance_domains</title>
<path fill="none" stroke="black" d="M392.1,-245.07C434.17,-233.87 491.8,-218.53 535.56,-206.89"/>
<polygon fill="black" stroke="black" points="536.47,-210.26 545.24,-204.31 534.67,-203.5 536.47,-210.26"/>
</g>
<!-- for_each_domain_LB -->
<g id="node9" class="node">
<title>for_each_domain_LB</title>
<ellipse fill="none" stroke="black" cx="599" cy="-106" rx="105.08" ry="18"/>
<text text-anchor="middle" x="599" y="-102.3" font-family="Times,serif" font-size="14.00">for_each_domain_LB</text>
</g>
<!-- rebalance_domains&#45;&gt;for_each_domain_LB -->
<g id="edge8" class="edge">
<title>rebalance_domains&#45;&gt;for_each_domain_LB</title>
<path fill="none" stroke="black" d="M599,-170.82C599,-160.19 599,-146.31 599,-134.2"/>
<polygon fill="black" stroke="black" points="602.5,-134.15 599,-124.15 595.5,-134.15 602.5,-134.15"/>
</g>
<!-- update_newidle_cost -->
<g id="node10" class="node">
<title>update_newidle_cost</title>
<ellipse fill="none" stroke="black" cx="248" cy="-34" rx="106.68" ry="18"/>
<text text-anchor="middle" x="248" y="-30.3" font-family="Times,serif" font-size="14.00">update_newidle_cost</text>
</g>
<!-- for_each_domain_LB&#45;&gt;update_newidle_cost -->
<g id="edge9" class="edge">
<title>for_each_domain_LB&#45;&gt;update_newidle_cost</title>
<path fill="none" stroke="black" d="M533.39,-91.92C474.09,-80.09 386.78,-62.68 324.36,-50.23"/>
<polygon fill="black" stroke="black" points="324.67,-46.72 314.18,-48.2 323.3,-53.59 324.67,-46.72"/>
</g>
<!-- get_sd_balance_interval -->
<g id="node11" class="node">
<title>get_sd_balance_interval</title>
<ellipse fill="none" stroke="black" cx="494" cy="-34" rx="121.58" ry="18"/>
<text text-anchor="middle" x="494" y="-30.3" font-family="Times,serif" font-size="14.00">get_sd_balance_interval</text>
</g>
<!-- for_each_domain_LB&#45;&gt;get_sd_balance_interval -->
<g id="edge10" class="edge">
<title>for_each_domain_LB&#45;&gt;get_sd_balance_interval</title>
<path fill="none" stroke="black" d="M574.12,-88.41C560.23,-79.15 542.73,-67.49 527.63,-57.42"/>
<polygon fill="black" stroke="black" points="529.33,-54.35 519.07,-51.71 525.45,-60.17 529.33,-54.35"/>
</g>
<!-- load_balance -->
<g id="node12" class="node">
<title>load_balance</title>
<ellipse fill="orange" stroke="black" cx="704" cy="-34" rx="70.39" ry="18"/>
<text text-anchor="middle" x="704" y="-30.3" font-family="Times,serif" font-size="14.00">load_balance</text>
</g>
<!-- for_each_domain_LB&#45;&gt;load_balance -->
<g id="edge11" class="edge">
<title>for_each_domain_LB&#45;&gt;load_balance</title>
<path fill="none" stroke="black" d="M623.88,-88.41C638.08,-78.95 656.04,-66.97 671.35,-56.76"/>
<polygon fill="black" stroke="black" points="673.64,-59.45 680.02,-50.99 669.76,-53.62 673.64,-59.45"/>
</g>
<!-- update_next_balance -->
<g id="node13" class="node">
<title>update_next_balance</title>
<ellipse fill="none" stroke="black" cx="900" cy="-34" rx="107.78" ry="18"/>
<text text-anchor="middle" x="900" y="-30.3" font-family="Times,serif" font-size="14.00">update_next_balance</text>
</g>
<!-- for_each_domain_LB&#45;&gt;update_next_balance -->
<g id="edge12" class="edge">
<title>for_each_domain_LB&#45;&gt;update_next_balance</title>
<path fill="none" stroke="black" d="M658.83,-91.09C708.11,-79.62 778.08,-63.35 829.97,-51.29"/>
<polygon fill="black" stroke="black" points="830.82,-54.68 839.77,-49.01 829.24,-47.86 830.82,-54.68"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.0 KiB