From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932886AbdEVTZP (ORCPT ); Mon, 22 May 2017 15:25:15 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:50014 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757576AbdEVTY5 (ORCPT ); Mon, 22 May 2017 15:24:57 -0400 Date: Mon, 22 May 2017 21:24:48 +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 Mon, 22 May 2017, Arnd Bergmann wrote: > On Sun, May 21, 2017 at 8:14 PM, Thomas Gleixner wrote: > > 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. > > A lot of those users could probably just ktime_get()/ktime_before() here, > as they would by definition not be performance critical. Right. > I don't see a way to just tk->tkr_mono.base but with a ktime_get_coarse() > we could just return the ktime_t of the last tick and not even need a seqlock > on 64-bit architectures, or have to introduce a new API. Yeah, that would be possible, but OTOH, for those loop thingies it probably does not matter at all whether you have the overhead of ktime_get() or not. We need to look at that stuff deeper. Thanks, tglx