Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754279AbcKIQ3k (ORCPT ); Wed, 9 Nov 2016 11:29:40 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33230 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932452AbcKIQ3j (ORCPT ); Wed, 9 Nov 2016 11:29:39 -0500 Date: Wed, 9 Nov 2016 17:29:27 +0100 From: luca abeni To: Juri Lelli Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Claudio Scordino , Steven Rostedt Subject: Re: [RFC v3 1/6] Track the active utilisation Message-ID: <20161109172927.21619bac@utopia> In-Reply-To: <20161108175635.GF16920@e106622-lin> References: <1477317998-7487-1-git-send-email-luca.abeni@unitn.it> <1477317998-7487-2-git-send-email-luca.abeni@unitn.it> <20161101164451.GA2769@ARMvm> <20161101221014.27eb441a@utopia> <20161108175635.GF16920@e106622-lin> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; i686-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: 2157 Lines: 51 On Tue, 8 Nov 2016 17:56:35 +0000 Juri Lelli wrote: [...] > > > > @@ -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); > > > > > > Don't rememeber if we discussed this already, but do we need to add the bw here > > > even if the task is not actually enqueued until after the replenishment timer > > > fires? > > I think yes... The active utilization does not depend on the fact that the task > > is on the runqueue or not, but depends on the task's state (in GRUB parlance, > > "inactive" vs "active contending"). In other words, even when a task is throttled > > its utilization must be counted in the active utilization. > > > > OK. Could you add a comment about this point please (so that I don't > forget again :)? So, I just changed the comment in /* * If p is throttled, we do not enqueue it. 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. * However, the active utilization does not depend on the fact * that the task is on the runqueue or not (but depends on the * task's state - in GRUB parlance, "inactive" vs "active contending"). * In other words, even if a task is throttled its utilization must * be counted in the active utilization; hence, we need to call * add_running_bw(). */ Is this ok? Thanks, Luca