Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754096AbcKRPGU (ORCPT ); Fri, 18 Nov 2016 10:06:20 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33064 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752084AbcKRPGS (ORCPT ); Fri, 18 Nov 2016 10:06:18 -0500 Date: Fri, 18 Nov 2016 16:06:10 +0100 From: luca abeni To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Juri Lelli , Claudio Scordino , Steven Rostedt Subject: Re: [RFC v3 1/6] Track the active utilisation Message-ID: <20161118160610.084da27d@sweethome> In-Reply-To: <20161118135554.GJ3142@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> <20161118135554.GJ3142@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: 1924 Lines: 58 Hi Peter, On Fri, 18 Nov 2016 14:55:54 +0100 Peter Zijlstra wrote: > On Mon, Oct 24, 2016 at 04:06:33PM +0200, Luca Abeni wrote: > > > @@ -498,6 +514,8 @@ static void update_dl_entity(struct > > sched_dl_entity *dl_se, struct dl_rq *dl_rq = dl_rq_of_se(dl_se); > > struct rq *rq = rq_of_dl_rq(dl_rq); > > > > + add_running_bw(dl_se, dl_rq); > > + > > if (dl_time_before(dl_se->deadline, rq_clock(rq)) || > > dl_entity_overflow(dl_se, pi_se, rq_clock(rq))) { > > dl_se->deadline = rq_clock(rq) + > > pi_se->dl_deadline; @@ -947,14 +965,19 @@ static void > > enqueue_task_dl(struct rq *rq, struct task_struct *p, int flags) > > return; } > > > > + if (p->on_rq == TASK_ON_RQ_MIGRATING) > > + add_running_bw(&p->dl, &rq->dl); > > + > > /* > > * If p is throttled, we do nothing. In fact, if it > > exhausted > > * its budget it needs a replenishment and, since it now > > is on > > * its rq, the bandwidth timer callback (which clearly has > > not > > * run yet) will take care of this. > > */ > > - if (p->dl.dl_throttled && !(flags & ENQUEUE_REPLENISH)) > > + if (p->dl.dl_throttled && !(flags & ENQUEUE_REPLENISH)) { > > + add_running_bw(&p->dl, &rq->dl); > > return; > > + } > > > > enqueue_dl_entity(&p->dl, pi_se, flags); > > > > I realize the enqueue path is a bit of a maze, but this hurts my head. > > Isn't there anything we can do to streamline this a bit? > > Maybe move the add_running_bw() from update_dl_entity() to the > ENQUEUE_WAKEUP branch in enqueue_dl_entity()? Because that's what you > really want, isn't it? Its not actually related to recomputing the > absolute deadline. Right... I'll change the code in this way. I am currently modifying this code (because after Juri's review I realized that there is an issue - see last email exchange with Juri); I'll make this change as soon as the code stabilizes. Thanks, Luca