From ce9d5e5aab6e295bcf2edf29706ddd82282e0560 Mon Sep 17 00:00:00 2001 From: gatieme Date: Wed, 29 Jun 2016 14:40:12 +0800 Subject: [PATCH] =?UTF-8?q?CFS=E8=B0=83=E5=BA=A6=E5=99=A8=E4=B9=8B?= =?UTF-8?q?=E8=99=9A=E6=8B=9F=E6=97=B6=E9=92=9F...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kernel/01-process/05-schedule/04-cfs/02-vruntime/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/study/kernel/01-process/05-schedule/04-cfs/02-vruntime/README.md b/study/kernel/01-process/05-schedule/04-cfs/02-vruntime/README.md index 4ca5dfd..f4f73f1 100644 --- a/study/kernel/01-process/05-schedule/04-cfs/02-vruntime/README.md +++ b/study/kernel/01-process/05-schedule/04-cfs/02-vruntime/README.md @@ -134,9 +134,10 @@ $$ delta =delta \times \dfrac{NICE\_0\_LOAD}{curr->se->load.weight}$$ | 条件 | 公式 | |:-------:|:-------:| -| curr.nice != NICE_0_LOAD | $curr->vruntime += delta\\_exec \times \dfrac{NICE\\_0\\_LOAD}{curr->se->load.weight}$ | +| curr.nice != NICE_0_LOAD | $curr->vruntime += delta\_exec \times \dfrac{NICE\_0\_LOAD}{curr->se->load.weight}$| | curr.nice == NICE_0_LOAD | $ curr->vruntime += delta $ | + 在该计算中可以派上用场了, 回想一下子, 可知越重要的进程会有越高的优先级(即, 越低的nice值), 会得到更大的权重, 因此累加的虚拟运行时间会小一点, 根据公式可知, nice = 0的进程(优先级120), 则虚拟时间和物理时间是相等的, 即current->se->load.weight等于NICE_0_LAD的情况.