Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753501AbcKRPrt (ORCPT ); Fri, 18 Nov 2016 10:47:49 -0500 Received: from merlin.infradead.org ([205.233.59.134]:46378 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752190AbcKRPrs (ORCPT ); Fri, 18 Nov 2016 10:47:48 -0500 Date: Fri, 18 Nov 2016 16:47:48 +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: <20161118154748.GN3142@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: 556 Lines: 21 On Mon, Oct 24, 2016 at 04:06:34PM +0200, Luca Abeni wrote: > @@ -1074,6 +1161,14 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags) > } > rcu_read_unlock(); > > + rq = task_rq(p); > + raw_spin_lock(&rq->lock); > + if (hrtimer_active(&p->dl.inactive_timer)) { > + sub_running_bw(&p->dl, &rq->dl); > + hrtimer_try_to_cancel(&p->dl.inactive_timer); > + } > + raw_spin_unlock(&rq->lock); Its a bit sad having to take rq->lock here... Also, what happens when hrtimer_try_to_cancel() fails? > + > out: > return cpu; > }