From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751710AbcFWI3P (ORCPT ); Thu, 23 Jun 2016 04:29:15 -0400 Received: from www.linutronix.de ([62.245.132.108]:46680 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750919AbcFWI3M (ORCPT ); Thu, 23 Jun 2016 04:29:12 -0400 Date: Thu, 23 Jun 2016 10:27:06 +0200 (CEST) From: Thomas Gleixner To: Cyril Hrubis 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 In-Reply-To: <20160622102858.GA13962@rei.lan> Message-ID: References: <20160617121134.417319325@linutronix.de> <1466581044.3188.34.camel@gmail.com> <20160622102858.GA13962@rei.lan> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 22 Jun 2016, Cyril Hrubis wrote: > Hi! > > > rtbox:~ # /usr/local/ltp/conformance/interfaces/sigtimedwait/sigtimedwait_1-1.run-test > > > Test FAILED: sigtimedwait() did not return in the required time > > > time_elapsed: 1.197057 > > > ...come on, you can do it... > > > rtbox:~ # /usr/local/ltp/conformance/interfaces/sigtimedwait/sigtimedwait_1-1.run-test > > > Test PASSED > > > > > > #define ERRORMARGIN 0.1 > > > ... > > > if ((time_elapsed > SIGTIMEDWAITSEC + ERRORMARGIN) > > > || (time_elapsed < SIGTIMEDWAITSEC - ERRORMARGIN)) { > > > printf("Test FAILED: sigtimedwait() did not return in " > > > "the required time\n"); > > > printf("time_elapsed: %lf\n", time_elapsed); > > > return PTS_FAIL; > > > } > > > > > > Looks hohum to me, but gripe did arrive with patch set, so you get a note. > > > > hohum is a euphemism. That's completely bogus. > > > > The only guarantee a syscall with timers has is: timer does not fire early. > > 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. Thanks, tglx