lkml.org 
[lkml]   [2017]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectWhat is the math behind sched_avg_update()?
Hi all,

In update_cpu_capacity(), it will calculate CPU's capacity with RT
utilization in mind. Which is introduced in commit
e9e9250bc78e7f6342517214c0178a529807964b
(https://lkml.org/lkml/2009/8/27/209).

rq->rt_avg and rq->age_stamp are introduced for tracing RT utilization in

a) update_curr_rt
sched_rt_avg_update
sched_avg_update

b) scheduler_tick
cpu_load_update_active
cpu_load_update_periodic (or cpu_load_update_nohz)
cpu_load_update
sched_avg_update


Curious about sched_avg_update(), why "rt->avg / 2^n" (where n denotes
periods passed since rq->age_stamp)?
- It will be a big summed value if next will meet the end of current
period, assuming several RT tasks are running
- But it will suddenly reduce to 1/2^n if just passed several periods

So, what is the math behind sched_avg_update()?



--
Regards,

- cee1

\
 
 \ /
  Last update: 2017-06-15 16:26    [W:0.034 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site