Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751481AbcDMEFF (ORCPT ); Wed, 13 Apr 2016 00:05:05 -0400 Received: from smtprelay0042.hostedemail.com ([216.40.44.42]:41743 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751098AbcDMEFC (ORCPT ); Wed, 13 Apr 2016 00:05:02 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3873:4321:5007:8531:10004:10400:10848:11026:11232:11658:11783:11914:12296:12517:12519:12740:13069:13255:13311:13357:13439:13894:14659:14721:21080:30054:30064:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: end71_2b95a7c6d0357 X-Filterd-Recvd-Size: 1914 Message-ID: <1460520294.24619.18.camel@perches.com> Subject: Re: [PATCH 2/4] sched/fair: Drop out incomplete current period when sched averages accrue From: Joe Perches To: Yuyang Du , Dietmar Eggemann Cc: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, bsegall@google.com, pjt@google.com, morten.rasmussen@arm.com, vincent.guittot@linaro.org, juri.lelli@arm.com Date: Tue, 12 Apr 2016 21:04:54 -0700 In-Reply-To: <20160412201448.GL8697@intel.com> References: <1460327765-18024-1-git-send-email-yuyang.du@intel.com> <1460327765-18024-3-git-send-email-yuyang.du@intel.com> <570CE3F2.5000806@arm.com> <20160412201448.GL8697@intel.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 809 Lines: 27 On Wed, 2016-04-13 at 04:14 +0800, Yuyang Du wrote: > On Tue, Apr 12, 2016 at 01:02:58PM +0100, Dietmar Eggemann wrote: > > 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/&&/& > Duh, :) You could also avoid the cast: now &= 0xFFFFull;