Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932600AbcDEMm7 (ORCPT ); Tue, 5 Apr 2016 08:42:59 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:40394 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758326AbcDEMmp (ORCPT ); Tue, 5 Apr 2016 08:42:45 -0400 Date: Tue, 5 Apr 2016 14:42:42 +0200 From: Peter Zijlstra To: Luca Abeni Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Juri Lelli Subject: Re: [RFC v2 3/7] Improve the tracking of active utilisation Message-ID: <20160405124242.GX3430@twins.programming.kicks-ass.net> References: <1459523553-29089-1-git-send-email-luca.abeni@unitn.it> <1459523553-29089-4-git-send-email-luca.abeni@unitn.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1459523553-29089-4-git-send-email-luca.abeni@unitn.it> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 902 Lines: 24 On Fri, Apr 01, 2016 at 05:12:29PM +0200, Luca Abeni wrote: > @@ -526,7 +575,18 @@ 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 the "inactive timer" is still active, stop it and leave > + * the active utilisation unchanged. > + * Otherwise, increase the active utilisation. > + * If the timer cannot be cancelled, inactive_task_timer() will > + * find the task state as TASK_RUNNING, and will do nothing, so > + * we are still safe. > + */ > + if (hrtimer_active(&dl_se->inactive_timer)) > + hrtimer_try_to_cancel(&dl_se->inactive_timer); _try_, what happens if that fails? > + else > + 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))) {