Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751658AbdCZUzW (ORCPT ); Sun, 26 Mar 2017 16:55:22 -0400 Received: from mail.santannapisa.it ([193.205.80.99]:36117 "EHLO mail.santannapisa.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751477AbdCZUzS (ORCPT ); Sun, 26 Mar 2017 16:55:18 -0400 Date: Sun, 26 Mar 2017 22:55:06 +0200 From: luca abeni To: Mathieu Poirier Cc: "linux-kernel@vger.kernel.org" , Peter Zijlstra , Ingo Molnar , Juri Lelli , Claudio Scordino , Steven Rostedt , Tommaso Cucinotta , Daniel Bristot de Oliveira , Joel Fernandes , Luca Abeni Subject: Re: [RFC v5 1/9] sched/deadline: track the active utilization Message-ID: <20170326225506.2ee92d24@nowhere> In-Reply-To: References: <1490327582-4376-1-git-send-email-luca.abeni@santannapisa.it> <1490327582-4376-2-git-send-email-luca.abeni@santannapisa.it> Organization: Scuola Superiore S.Anna 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: 1642 Lines: 53 Hi Mathieu, On Sun, 26 Mar 2017 11:04:18 -0600 Mathieu Poirier wrote: [...] > > @@ -946,8 +968,12 @@ enqueue_dl_entity(struct sched_dl_entity > > *dl_se, > > * parameters of the task might need updating. Otherwise, > > * we want a replenishment of its runtime. > > */ > > - if (flags & ENQUEUE_WAKEUP) > > + if (flags & ENQUEUE_WAKEUP) { > > + struct dl_rq *dl_rq = dl_rq_of_se(dl_se); > > + > > + add_running_bw(dl_se->dl_bw, dl_rq); > > update_dl_entity(dl_se, pi_se); > > + } > > What do we do for tasks that go from normal to dl? Unless I'm > mistaking their utilisation won't be accounted for when they are first > enqueued. This case should be handled by the "if (flags & ENQUEUE_WAKEUP)" branch in enqueue_dl_entity(). [...] > > diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h > > index 57caf36..caaa7d3 100644 > > --- a/kernel/sched/sched.h > > +++ b/kernel/sched/sched.h > > @@ -558,6 +558,12 @@ struct dl_rq { > > #else > > struct dl_bw dl_bw; > > #endif > > + /* > > + * "Active utilization" for this runqueue: increased when a > > + * task wakes up (becomes TASK_RUNNING) and decreased when a > > + * task blocks > > + */ > > + u64 running_bw; > > Would it be a good idea to initialise and clear this field in > rq_online/offline_dl()? Thanks for pointing this out... I have to admit I do not know the online/offline code too much (and I am not sure if I am handling this correctly). I'll try to have a look on Monday. Thanks, Luca