From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751537AbcFWLwX (ORCPT ); Thu, 23 Jun 2016 07:52:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:49615 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751436AbcFWLwV (ORCPT ); Thu, 23 Jun 2016 07:52:21 -0400 Date: Thu, 23 Jun 2016 13:47:59 +0200 From: Cyril Hrubis To: Thomas Gleixner Cc: Mike Galbraith , Rik van Riel , Len Brown , Peter Zijlstra , Frederic Weisbecker , LKML , George Spelvin , Chris Mason , Eric Dumazet , rt@linutronix.de, "Paul E. McKenney" , Linus Torvalds , Ingo Molnar , ltp@lists.linux.it, Arjan van de Ven Subject: Re: [LTP] [patch V2 00/20] timer: Refactor the timer wheel Message-ID: <20160623114759.GA19250@rei.lan> References: <20160617121134.417319325@linutronix.de> <1466581044.3188.34.camel@gmail.com> <20160622102858.GA13962@rei.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > > While this is true, checking with reasonable error margin works just > > fine 99% of the time. You cannot really test that timer expires, without > > setting arbitrary margin. > > Err. You know that the timer expired because sigtimedwait() returns > EAGAIN. And the only thing you can reliably check for is that the timer did > not expired to early. Anything else is guesswork and voodoo programming. There is quite a lot of things that can happen on mutitasking OS and there are even NMIs in hardware, etc. But seriously is there a reason why OS that is not under heavy load cannot expire timers with reasonable overruns? I.e. if I ask for a second of sleep and expect it to be woken up not much more than half of a second later? If we stick only to guarantees that are defined in POSIX playing music with mplayer would not be possible since it sleeps in futex() and if it wakes too late it will fail to fill buffers. In practice this worked fine for me for years. -- Cyril Hrubis chrubis@suse.cz