[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAGXxSxV-=9WRgzzd=HM4GsYaw+wQN8XbAfBQXNwTtoPdLbGtpA@mail.gmail.com>
Date:   Thu, 15 Jun 2017 22:25:49 +0800
From:   cee1 <fykcee1@...il.com>
To:     LKML <linux-kernel@...r.kernel.org>
Cc:     Peter Zijlstra <peterz@...radead.org>
Subject: What 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
Powered by blists - more mailing lists
 
