Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933566AbcDLMDF (ORCPT ); Tue, 12 Apr 2016 08:03:05 -0400 Received: from foss.arm.com ([217.140.101.70]:55011 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932467AbcDLMDC (ORCPT ); Tue, 12 Apr 2016 08:03:02 -0400 Subject: Re: [PATCH 2/4] sched/fair: Drop out incomplete current period when sched averages accrue To: Yuyang Du , peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org References: <1460327765-18024-1-git-send-email-yuyang.du@intel.com> <1460327765-18024-3-git-send-email-yuyang.du@intel.com> Cc: bsegall@google.com, pjt@google.com, morten.rasmussen@arm.com, vincent.guittot@linaro.org, juri.lelli@arm.com From: Dietmar Eggemann Message-ID: <570CE3F2.5000806@arm.com> Date: Tue, 12 Apr 2016 13:02:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1460327765-18024-3-git-send-email-yuyang.du@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 550 Lines: 23 On 10/04/16 23:36, Yuyang Du wrote: [...] > @@ -2704,11 +2694,14 @@ static __always_inline int > __update_load_avg(u64 now, int cpu, struct sched_avg *sa, > unsigned long weight, int running, struct cfs_rq *cfs_rq) > { > - u64 delta, scaled_delta, periods; > - u32 contrib; > - unsigned int delta_w, scaled_delta_w, decayed = 0; > + u64 delta; > + u32 contrib, periods; > unsigned long scale_freq, scale_cpu; > > + /* > + * now rolls down to a period boundary > + */ > + now = now && (u64)(~0xFFFFF); This forces now to be 1. s/&&/&