From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759674Ab2ILOul (ORCPT ); Wed, 12 Sep 2012 10:50:41 -0400 Received: from casper.infradead.org ([85.118.1.10]:53905 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759456Ab2ILOuk convert rfc822-to-8bit (ORCPT ); Wed, 12 Sep 2012 10:50:40 -0400 Message-ID: <1347461431.15764.49.camel@twins> Subject: Re: [PATCH v2 2/3] perf: use hrtimer for event multiplexing From: Peter Zijlstra To: Stephane Eranian Cc: LKML , "mingo@elte.hu" , "ak@linux.intel.com" , "Yan, Zheng" , Robert Richter Date: Wed, 12 Sep 2012 16:50:31 +0200 In-Reply-To: References: <1347459195-5491-1-git-send-email-eranian@google.com> <1347459195-5491-3-git-send-email-eranian@google.com> <1347459764.15764.32.camel@twins> <1347461060.15764.44.camel@twins> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Mailer: Evolution 3.2.2- Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2012-09-12 at 16:48 +0200, Stephane Eranian wrote: > On Wed, Sep 12, 2012 at 4:44 PM, Peter Zijlstra wrote: > > On Wed, 2012-09-12 at 16:43 +0200, Stephane Eranian wrote: > >> The hrtimer_active is used to prevent activating the timer multiple times > >> in a row. > > > > see hrtimer_active(), this should do what you want I think. > > I need something that is true even when the hrtimer is not executing > the callback handler. I guess that may be the different between > hrtimer_active() vs. hrtimer_running()? As the comment states, hrtimer_active() returns true if the timer is either in the tree (enqueued) or running. hrtimer_callback_running() is true iff the callback is currently executing. hrtimer_queued() is true iff the timer is queued.