Hi Peter, On Wed, Mar 29, 2017 at 12:41:26PM +0200, Peter Zijlstra wrote: > On Wed, Mar 29, 2017 at 08:04:42AM +0800, Yuyang Du wrote: > > Yes, you need to, and let me do it too and learn how you will rewrite > > it. > > I've meanwhile written this. Does that work for you? It works. You sort it out.
I hope I get along with going into detail too ... Some grammar and typo issues: > --- > Subject: sched/fair: Optimize ___update_sched_avg() > From: Yuyang Du <yuyang...@intel.com> > Date: Mon, 13 Feb 2017 05:44:23 +0800 > > The main PELT function ___update_load_avg(), that implements the ~~~~ which > accumulation and progression of the geometric average series, is > implemented along the following lines for the scenario where the time > delta spans all 3 possible sections (see figure below): > > 1. add the remainder of the last incomplete period > 2. decay old sum > 3. accumulate new sum in full periods since last_update_time > 4. accumulate the current incomplete period > 5. update averages > > Or: > > d1 d2 d3 > ^ ^ ^ > | | | > |<->|<----------------->|<--->| > ... |---x---|------| ... |------|-----x (now) > > > load_sum' = (load_sum + weight * scale * d1) * y^(p+1) + (1,2) > > p > weight * scale * 1024 * \Sum y^n + (3) > n=1 > > weight * sclae * d3 * y^0 (4) ~~~~~ scale Thanks, Yuyang