请教xtang,我今天有看到"adaptive partitioning"文档,不懂,请指点!

官方文档:Adaptive Partitioning User’s Guide [6.5.0]
下载地址:http://www.qnx.com/download/group.html?programid=20945
文档:adaptive_partitioning.pdf

这个文档中p33~p34页说的我有点不明白?

原文如下:
“The adaptive partitioning thread scheduler throttles CPU usage by measuring the average CPU usage of each partition. The average is computed over an averaging window (typically 100 milliseconds), a
value that is configurable.”------这个明白

“The window size defines the averaging time over which the thread scheduler attempts to balance the partitions to their guaranteed CPU limits. You can set the averaging window size to any value from 8 milliseconds to 400 milliseconds.”

以上是说: adaptive partitioning线程调度器通过测量每个partition的CPU平均使用率来控制的,而这个平均值是通过“ an averaging window”被计算。然后呢,window size 定义 an averaging time。

后面的文档又讲到:
“Window 2 Typically 10 times the window size.
Window 3 Typically 100 times the window size.”

这个Window 2和Window 3是什么??
跟Averaging window又有什么关系,看的云里雾里的。

请指教,谢谢

补充:我的理解
自适应分区, 如果我用不到70%, 而其它程序又需要cpu的时候, 可以拿去用.
只是当我需要的时候,系统会保证你的70%的可利用率.

|---- CPU Time – |-- Critical Time --|
Partition name id | Budget | Used | Budget | Used
--------------------±-----------------±------------------
System 0 | 70% | 0.04% | 200ms| 0.000ms
Pa 1 | 20% | 65.96% | 0ms | 0.000ms
Pb 2 | 10% | 33.96% | 0ms | 0.000ms
--------------------±-----------------±------------------
Total | 100% | 99.96% |

System 0分配的Budget 为70%,但是使用率极低,完全处于空闲的状态
而Pb2分配的Budget 为10%,使用率极高,完全不能满足我的需要,所以把
System 0的一部分使用给Pb 2,这就叫所谓的自适应分区!!!哈

不过那个Window 2,Window 3,还有an averaging window之间的关系,我搞不清楚!!!

你的理解基本是正确的。不过,PB2占用更多CPU的前提是System(或是别的分区)有空闲CPU的情况。如果SYSTEM分区有任何进程(哪怕优先级很低)需要CPU,那个进程会被优先满足,PB2占用的CPU就会相应减小。

你提到的Window2和Window3是用来计算状态的,如果你做个aps show -vv就可以清楚地看到一个分区

1)"在刚过去的average window (100ms) 时间段里占了多少CPU“,
2)”在过去的window2 (1s)时间段里占了多少CPU
3)“在过去的window3(10s)时间段里占了多少CPU

window2 window3只是用来做状态计数的,实际并不参于调度计算。

谢谢