From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933176AbXCKFf6 (ORCPT ); Sun, 11 Mar 2007 00:35:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933180AbXCKFf6 (ORCPT ); Sun, 11 Mar 2007 00:35:58 -0500 Received: from smtp.osdl.org ([65.172.181.24]:36889 "EHLO smtp.osdl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933176AbXCKFf5 (ORCPT ); Sun, 11 Mar 2007 00:35:57 -0500 Date: Sat, 10 Mar 2007 21:35:54 -0800 (PST) From: Linus Torvalds To: Davide Libenzi cc: Nicholas Miell , Linux Kernel Mailing List , Andrew Morton Subject: Re: [patch 6/9] signalfd/timerfd v1 - timerfd core ... In-Reply-To: Message-ID: References: <1173508384.3108.1.camel@entropy> <1173509019.3108.4.camel@entropy> <1173510568.3108.17.camel@entropy> <1173556374.2958.12.camel@entropy> <1173560473.2958.23.camel@entropy> <1173563796.2958.28.camel@entropy> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 10 Mar 2007, Davide Libenzi wrote: > On Sat, 10 Mar 2007, Linus Torvalds wrote: > > > (That said, using "struct itimerspec" might be a good idea. That would > > also obviate the need for TFD_TIMER_SEQ, since an itimerspec automatically > > has both "base" and "incremental" parts). > > But TFD_TIMER_SEQ is a simple auto-rearm case of TFD_TIMER_REL. So the > timespec is sufficent too (in all three cases we just need *one* time). Well, people actually do use itimers like "give me a timer every second, starting five seconds from now". > Actually, the only place where I can find the itimerspec usefull, is > indeed with TFD_TIMER_SEQ. In cases where you want you clock starting at a > given time (it_value) *and* with the given frequency (it_interval). .. and this is where itimerspec is even better: once you have absolute time, *and* a process that might miss ticks (because it does something else), the "absolute time start + interval" thing can avoid drifting (which a "relative interval" has a really hard time doing). So if you want a "timer tick every second, *on* the second" kind of interface, you really do want a absolute time starting point, and then a fixed interval. Two different times. Linus