From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755674AbcAOIcn (ORCPT ); Fri, 15 Jan 2016 03:32:43 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:55825 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754015AbcAOIcl (ORCPT ); Fri, 15 Jan 2016 03:32:41 -0500 Date: Fri, 15 Jan 2016 09:32:34 +0100 From: Peter Zijlstra To: Luca Abeni Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Juri Lelli Subject: Re: [RFC 4/8] Improve the tracking of active utilisation Message-ID: <20160115083234.GB3421@worktop> References: <1452785094-3086-1-git-send-email-luca.abeni@unitn.it> <1452785094-3086-5-git-send-email-luca.abeni@unitn.it> <20160114194752.GD6357@twins.programming.kicks-ass.net> <5698A967.5050300@unitn.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5698A967.5050300@unitn.it> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 15, 2016 at 09:10:15AM +0100, Luca Abeni wrote: > On 01/14/2016 08:47 PM, Peter Zijlstra wrote: > >On Thu, Jan 14, 2016 at 04:24:49PM +0100, Luca Abeni wrote: > > > >>+ if (!hrtimer_is_queued(timer)) { > >>+ hrtimer_start(timer, act, HRTIMER_MODE_ABS); > >>+ } > >>+ > >>+ if (hrtimer_active(timer) == 0) { > >>+ printk("Problem activating inactive_timer!\n"); > >>+ clear_running_bw(dl_se, dl_rq); > >>+ if (!dl_task(p)) { > >>+ __dl_clear_params(p); > >>+ } > >>+ } else { > >>+ get_task_struct(p); > > > >Ah, I missed that one. I would suggest putting that right _before_ > >hrtimer_start(), because hrtimer_start() guarantees the callback will > >run. > Ok. So, if I understand well, the "if (hrtimer_active(timer) == 0)" check > is useless (or should be somehow revised)... Right? Yes, ever since: c6eb3f70d448 ("hrtimer: Get rid of hrtimer softirq") hrtimer_start() is guaranteed to work and result in a callback, even if the time is in the past.