Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754332AbcKRPKf (ORCPT ); Fri, 18 Nov 2016 10:10:35 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33130 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754312AbcKRPKd (ORCPT ); Fri, 18 Nov 2016 10:10:33 -0500 Date: Fri, 18 Nov 2016 16:10:17 +0100 From: luca abeni To: Peter Zijlstra Cc: Steven Rostedt , Daniel Bristot de Oliveira , linux-kernel@vger.kernel.org, Ingo Molnar , Juri Lelli , Claudio Scordino Subject: Re: [RFC v3 1/6] Track the active utilisation Message-ID: <20161118161017.45e19cb9@sweethome> In-Reply-To: <20161118142359.GK3142@twins.programming.kicks-ass.net> References: <1477317998-7487-1-git-send-email-luca.abeni@unitn.it> <1477317998-7487-2-git-send-email-luca.abeni@unitn.it> <20161025112916.67eb245c@utopia> <20161025095811.50a5856a@gandalf.local.home> <20161118142359.GK3142@twins.programming.kicks-ass.net> Organization: university of trento X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1512 Lines: 56 On Fri, 18 Nov 2016 15:23:59 +0100 Peter Zijlstra wrote: > On Tue, Oct 25, 2016 at 09:58:11AM -0400, Steven Rostedt wrote: > > > I agree with Daniel, especially since I don't usually trust the > > compiler. And the added variable is more of a distraction as it > > doesn't seem to have any real purpose. > > I don't think there's anything here to trust the compiler on. Either > it inlines or it doesn't, it should generate 'correct' code either > way. > > If it doesn't inline, its a dumb compiler and it will make these dumb > decisions throughout the tree and your kernel will be slow, not my > problem really ;-) > > That said, I agree that the single line thing is actually easier to > read. Ok; I already made that change locally. > > That said; there's something to be said for: > > u64 running_bw; Ok; I originally made it signed because I wanted the "running_bw < 0" check, but I can change it to "dl_rq->running_bw > old" (I did not think about it). I'll make these changes locally ASAP. Thanks, Luca > > static void add_running_bw(struct sched_dl_entity *dl_se, struct > dl_rq *dl_rq) { > u64 old = dl_rq->running_bw; > > dl_rq->running_bw += dl_se->dl_bw; > SCHED_WARN_ON(dl_rq->running_bw < old); /* overflow */ > } > > static void sub_running_bw(struct sched_dl_entity *dl_se, struct > dl_rq *dl_rq) { > u64 old = dl_rq->running_bw; > > dl_rq->running_bw -= dl_se->dl_bw; > SCHED_WARN_ON(dl_rq->running_bw > old); /* underflow */ > } > >