From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751244AbcFWPPu (ORCPT ); Thu, 23 Jun 2016 11:15:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:36583 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750874AbcFWPPt (ORCPT ); Thu, 23 Jun 2016 11:15:49 -0400 Date: Thu, 23 Jun 2016 17:11:27 +0200 From: Cyril Hrubis To: George Spelvin Cc: tglx@linutronix.de, arjan@infradead.org, clm@fb.com, edumazet@google.com, fweisbec@gmail.com, lenb@kernel.org, linux-kernel@vger.kernel.org, ltp@lists.linux.it, mingo@kernel.org, paulmck@linux.vnet.ibm.com, peterz@infradead.org, riel@redhat.com, rt@linutronix.de, torvalds@linux-foundation.org, umgwanakikbuti@gmail.com Subject: Re: [LTP] [patch V2 00/20] timer: Refactor the timer wheel Message-ID: <20160623151127.GA20808@rei.lan> References: <20160623114759.GA19250@rei.lan> <20160623135803.636.qmail@ns.sciencehorizons.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160623135803.636.qmail@ns.sciencehorizons.net> 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! > Two points: > 1) sigtimedwait() is unusual in that it uses the jiffies timer. Most > system call timeouts (including specifically the one in FUTEX_WAIT) > use the high-resolution timer subsystem, which is a whole different > animal with tighter guarantees, and That is likely POSIX conformance bug, since POSIX explicitly states that sigtimedwait() shall use CLOCK_MONOTONIC to measure the timeout. "If the Monotonic Clock option is supported, the CLOCK_MONOTONIC clock shall be used to measure the time interval specified by the timeout argument." > 2) The worst-case error in tglx's proposal is 1/8 of the requested > timeout: the wakeup is after 112.5% of the requested time, plus > one tick. This is well within your requested accuracy. (For very > short timeouts, the "plus one tick" can dominate the percentage error.) Hmm, that still does not add up to the number in the original email where it says time_elapsed: 1.197057. As far as I can tell the worst case for a tick is CONFIG_HZ=100 so one tick is 0.01s and even after that we get 118.7% since we requested 1s. But that may be caused by the fact that the test uses gettimeofday() to measure the elapsed time, it should use CLOCK_MONOTONIC instead. -- Cyril Hrubis chrubis@suse.cz