From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756731AbdEUSPC (ORCPT ); Sun, 21 May 2017 14:15:02 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:34581 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756633AbdEUSPA (ORCPT ); Sun, 21 May 2017 14:15:00 -0400 Date: Sun, 21 May 2017 20:14:45 +0200 (CEST) From: Thomas Gleixner To: Arnd Bergmann cc: Christoph Hellwig , Tejun Heo , linuxppc-dev , Mark Gross , Linux Kernel Mailing List , linux-s390 Subject: Re: RFC: better timer interface In-Reply-To: Message-ID: References: <20170516114812.10660-1-hch@lst.de> <20170516155132.GA1494@lst.de> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 21 May 2017, Thomas Gleixner wrote: > On Tue, 16 May 2017, Arnd Bergmann wrote: > > On Tue, May 16, 2017 at 5:51 PM, Christoph Hellwig wrote: > > > Yes, that sounds useful to me as well. As you said it's an independent > > > but somewhat related change. I can add it to my series, but I'll > > > need a suggestions for a good and short name. That already was the > > > hardest part for the setup side :) > > > > If we keep the unusual *_timer() naming (rather than timer_*() as hrtimer > > has), we could use one of > > > > a) start_timer(struct timer_list *timer, unsigned long ms); > > b) restart_timer(struct timer_list *timer, unsigned long ms); > > c) mod_timer_ms(struct timer_list *timer, unsigned long ms); > > mod_timer_sec(struct timer_list *timer, unsigned long sec); > > Please make new functions prefixed with timer_ and get rid of that old > interface completely. It's horrible. > > timer_init() > timer_start(timer, ms, abs) I'm not even sure, whether we need absolute timer wheel timers at all, because most use cases are relative to now. But it's easy enough to provide them. All we need for that is something like unsigned long time_msec; which gets incremented every tick by the appropriate amount of milliseconds. Having that would also allow to replace all the end = jiffies + msec_to_jiffies(xxx); while (time_before(jiffies, end)) .... constructs with a milliseconds based machinery. So we can remove all *_to_jiffies() interfaces over time. Thanks, tglx