Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752905AbcKRPgR (ORCPT ); Fri, 18 Nov 2016 10:36:17 -0500 Received: from merlin.infradead.org ([205.233.59.134]:46354 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751527AbcKRPgQ (ORCPT ); Fri, 18 Nov 2016 10:36:16 -0500 Date: Fri, 18 Nov 2016 16:36:15 +0100 From: Peter Zijlstra To: Luca Abeni Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Juri Lelli , Claudio Scordino , Steven Rostedt Subject: Re: [RFC v3 2/6] Improve the tracking of active utilisation Message-ID: <20161118153615.GM3142@twins.programming.kicks-ass.net> References: <1477317998-7487-1-git-send-email-luca.abeni@unitn.it> <1477317998-7487-3-git-send-email-luca.abeni@unitn.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1477317998-7487-3-git-send-email-luca.abeni@unitn.it> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1188 Lines: 31 On Mon, Oct 24, 2016 at 04:06:34PM +0200, Luca Abeni wrote: > @@ -514,7 +556,20 @@ 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); > > + if (hrtimer_is_queued(&dl_se->inactive_timer)) { > + hrtimer_try_to_cancel(&dl_se->inactive_timer); > + WARN_ON(dl_task_of(dl_se)->nr_cpus_allowed > 1); Isn't that always so? That is, DL tasks cannot be but 'global', right? Also, you could use the return value of hrtimer_try_to_cancel() to determine hrtimer_is_queued() I suppose. > + } else { > + /* > + * The "inactive timer" has been cancelled in > + * select_task_rq_dl() (and the acvive utilisation has > + * been decreased). So, increase the active utilisation. > + * If select_task_rq_dl() could not cancel the timer, > + * inactive_task_timer() will * find the task state as ^^^ superfluous '*'? > + * TASK_RUNNING, and will do nothing, so we are still safe. > + */ > + 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))) {