Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932111AbdLOOCl (ORCPT ); Fri, 15 Dec 2017 09:02:41 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:56506 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755743AbdLOOCX (ORCPT ); Fri, 15 Dec 2017 09:02:23 -0500 Date: Fri, 15 Dec 2017 14:02:18 +0000 From: Patrick Bellasi To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Paul Turner , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes Subject: Re: [PATCH v2 2/4] sched/fair: add util_est on top of PELT Message-ID: <20171215140218.GC19821@e110439-lin> References: <20171205171018.9203-1-patrick.bellasi@arm.com> <20171205171018.9203-3-patrick.bellasi@arm.com> <20171213160537.uqa423dyt5wrpgll@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171213160537.uqa423dyt5wrpgll@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 937 Lines: 31 On 13-Dec 17:05, Peter Zijlstra wrote: > On Tue, Dec 05, 2017 at 05:10:16PM +0000, Patrick Bellasi wrote: > > + if (cfs_rq->nr_running > 0) { > > + util_est = cfs_rq->util_est_runnable; > > + util_est -= task_util_est(p); > > + if (util_est < 0) > > + util_est = 0; > > + cfs_rq->util_est_runnable = util_est; > > + } else { > > I'm thinking that's an explicit load-store to avoid intermediate values > landing in cfs_rq->util_esp_runnable, right? Was mainly to have an unsigned util_est for the following "sub"... > That would need READ_ONCE() / WRITE_ONCE() I think, without that the > compiler is free to munge the lot together. ... do we still need the {READ,WRITE}_ONCE() in this case? I guess adding them however does not hurts. Steering back at that code however it can likely by optimized to avoid the else branch... will update and add the barriers. Cheers Patrick. -- #include Patrick Bellasi