Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754405AbdC3Cqu (ORCPT ); Wed, 29 Mar 2017 22:46:50 -0400 Received: from mga05.intel.com ([192.55.52.43]:1354 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754211AbdC3Cqt (ORCPT ); Wed, 29 Mar 2017 22:46:49 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,244,1486454400"; d="scan'208";a="82133147" Date: Thu, 30 Mar 2017 02:41:57 +0800 From: Yuyang Du To: Peter Zijlstra Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, pjt@google.com, bsegall@google.com, morten.rasmussen@arm.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, matt@codeblueprint.co.uk, umgwanakikbuti@gmail.com Subject: Re: [RESEND PATCH 2/2] sched/fair: Optimize __update_sched_avg() Message-ID: <20170329184156.GA16440@ydu19desktop> References: <1486935863-25251-1-git-send-email-yuyang.du@intel.com> <1486935863-25251-3-git-send-email-yuyang.du@intel.com> <20170328144625.GX3093@worktop> <20170329000442.GC2459@ydu19desktop> <20170329104126.lg6ismevfbqywpcj@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170329104126.lg6ismevfbqywpcj@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1696 Lines: 55 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 > 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