From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: Re: [PATCH 1/3] timer: inform periodic timers of multiple expiries Date: Fri, 30 Jun 2017 12:14:31 +0200 Message-ID: <20170630121431.0899f624@platinum> References: <20170428132538.15995-1-bruce.richardson@intel.com> <20170531091621.203189-1-bruce.richardson@intel.com> <20170531091621.203189-2-bruce.richardson@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Robert Sanford , dev@dpdk.org To: Bruce Richardson Return-path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 0877F271 for ; Fri, 30 Jun 2017 12:14:33 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id w126so105496802wme.0 for ; Fri, 30 Jun 2017 03:14:33 -0700 (PDT) In-Reply-To: <20170531091621.203189-2-bruce.richardson@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Bruce, On Wed, 31 May 2017 10:16:19 +0100, Bruce Richardson wrote: > if timer_manage is called much less frequently than the period of a > periodic timer, then timer expiries will be missed. For example, if a timer > has a period of 300us, but timer_manage is called every 1ms, then there > will only be one timer callback called every 1ms instead of 3 within that > time. > > While we can fix this by having each function called multiple times within > timer-manage, this will lead to out-of-order timeouts, and will be slower > with all the function call overheads - especially in the case of a timeout > doing something trivial like incrementing a counter. Therefore, we instead > modify the callback functions to take a counter value of the number of > expiries that have passed since the last time it was called. > > Signed-off-by: Bruce Richardson Sorry, it's probably a bit late to react. If it's too late, nevermind. I'm not really convinced that adding another argument to the callback function is the best solution. Invoking the callbacks several times would result in a much smaller patch that does not need a heavy ABI compat. I'm not sure the function call overhead is really significant in that case. I'm not sure I understand your point related to out-of-order timeouts, nor I see why this patchset would behave better. About the problem itself, my understanding was that the timer manage function has to be called frequently enough to process the timers. Olivier