[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170331071352.sukbf6su5ng22oyc@hirez.programming.kicks-ass.net>
Date: Fri, 31 Mar 2017 09:13:52 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Yuyang Du <yuyang.du@...el.com>
Cc: Paul Turner <pjt@...gle.com>, Ingo Molnar <mingo@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Benjamin Segall <bsegall@...gle.com>,
Morten Rasmussen <morten.rasmussen@....com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Matt Fleming <matt@...eblueprint.co.uk>,
umgwanakikbuti@...il.com
Subject: Re: [RESEND PATCH 2/2] sched/fair: Optimize __update_sched_avg()
On Fri, Mar 31, 2017 at 03:41:18AM +0800, Yuyang Du wrote:
> > >
> > > p
> > > c2 = 1024 \Sum y^n
> > > n=1
> > >
> > > inf inf
> > > = 1024 ( \Sum y^n - \Sum y^n - y^0 )
> > > n=0 n=p
> >
> > It looks surprisingly kinda works :)
> >
> > > + c2 = LOAD_AVG_MAX - decay_load(LOAD_AVG_MAX, periods) - 1024;
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > But, I'm not sure this is what you want (just assume p==0).
> >
>
> Oh, what I meant is when p != 0, actually p>=1.
Right, note that we'll never get here with p==0. For p==1 we'll have
c2==0, and for p > 1 we'll have whatever section we wanted.
> And thinking about it for a while, it's really what you want, brilliant :)
Right, because:
inf inf inf
( \Sum y^n ) y^p = \Sum y^(n+p) = \Sum y^n
n=0 n=0 n=p
Powered by blists - more mailing lists