Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752720AbdGEL71 (ORCPT ); Wed, 5 Jul 2017 07:59:27 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:57351 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752525AbdGEL7Z (ORCPT ); Wed, 5 Jul 2017 07:59:25 -0400 Date: Wed, 5 Jul 2017 13:59:15 +0200 From: Peter Zijlstra To: Ganesh Mahendran Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, stable@vger.kernel.org Subject: Re: [PATCH] sched/fair: fix contribution calculation Message-ID: <20170705115915.GE4941@worktop> References: <1499244390-4406-1-git-send-email-opensource.ganesh@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1499244390-4406-1-git-send-email-opensource.ganesh@gmail.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 949 Lines: 28 On Wed, Jul 05, 2017 at 04:46:30PM +0800, Ganesh Mahendran wrote: > Function __compute_runnable_contrib() is to calculate: > \Sum 1024*y^n {for (1..n_period)} > But LOAD_AVG_MAX returns sum of 1024*y^n (0..n_period). > So we need to subtract 1024*y^0. > > Cc: stable@vger.kernel.org > Signed-off-by: Ganesh Mahendran > --- > kernel/sched/fair.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 90e26b1..777ad49 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -2508,7 +2508,7 @@ static u32 __compute_runnable_contrib(u64 n) > if (likely(n <= LOAD_AVG_PERIOD)) > return runnable_avg_yN_sum[n]; > else if (unlikely(n >= LOAD_AVG_MAX_N)) > - return LOAD_AVG_MAX; > + return LOAD_AVG_MAX - 1024; > > /* Compute \Sum k^n combining precomputed values for k^i, \Sum k^j */ > do { This code no longer exists...