提交 3841cdc3 编写于 作者: P Peter Zijlstra 提交者: Ingo Molnar

sched/fair: Fix comments

Historically our periods (or p) argument in PELT denoted the number of
full periods (what is now d2). However recent patches have changed
this to the total decay (previously p+1), leading to a confusing
discrepancy between comments and code.

Try and clarify things by making periods (in code) and p (in comments)
be the same thing (again).
Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: NIngo Molnar <mingo@kernel.org>
上级 76d034ed
...@@ -2777,18 +2777,18 @@ static u32 __accumulate_pelt_segments(u64 periods, u32 d1, u32 d3) ...@@ -2777,18 +2777,18 @@ static u32 __accumulate_pelt_segments(u64 periods, u32 d1, u32 d3)
u32 c1, c2, c3 = d3; /* y^0 == 1 */ u32 c1, c2, c3 = d3; /* y^0 == 1 */
/* /*
* c1 = d1 y^(p+1) * c1 = d1 y^p
*/ */
c1 = decay_load((u64)d1, periods); c1 = decay_load((u64)d1, periods);
/* /*
* p * p-1
* c2 = 1024 \Sum y^n * c2 = 1024 \Sum y^n
* n=1 * n=1
* *
* inf inf * inf inf
* = 1024 ( \Sum y^n - \Sum y^n - y^0 ) * = 1024 ( \Sum y^n - \Sum y^n - y^0 )
* n=0 n=p+1 * n=0 n=p
*/ */
c2 = LOAD_AVG_MAX - decay_load(LOAD_AVG_MAX, periods) - 1024; c2 = LOAD_AVG_MAX - decay_load(LOAD_AVG_MAX, periods) - 1024;
...@@ -2808,15 +2808,15 @@ static u32 __accumulate_pelt_segments(u64 periods, u32 d1, u32 d3) ...@@ -2808,15 +2808,15 @@ static u32 __accumulate_pelt_segments(u64 periods, u32 d1, u32 d3)
* |<->|<----------------->|<--->| * |<->|<----------------->|<--->|
* ... |---x---|------| ... |------|-----x (now) * ... |---x---|------| ... |------|-----x (now)
* *
* p * p-1
* u' = (u + d1) y^(p+1) + 1024 \Sum y^n + d3 y^0 * u' = (u + d1) y^p + 1024 \Sum y^n + d3 y^0
* n=1 * n=1
* *
* = u y^(p+1) + (Step 1) * = u y^p + (Step 1)
* *
* p * p-1
* d1 y^(p+1) + 1024 \Sum y^n + d3 y^0 (Step 2) * d1 y^p + 1024 \Sum y^n + d3 y^0 (Step 2)
* n=1 * n=1
*/ */
static __always_inline u32 static __always_inline u32
accumulate_sum(u64 delta, int cpu, struct sched_avg *sa, accumulate_sum(u64 delta, int cpu, struct sched_avg *sa,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册