From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751710AbcFZUCw (ORCPT ); Sun, 26 Jun 2016 16:02:52 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:44085 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751451AbcFZUCv (ORCPT ); Sun, 26 Jun 2016 16:02:51 -0400 Date: Sun, 26 Jun 2016 22:02:48 +0200 From: Pavel Machek To: Arjan van de Ven Cc: Thomas Gleixner , Mike Galbraith , LKML , Ingo Molnar , Peter Zijlstra , "Paul E. McKenney" , Eric Dumazet , Frederic Weisbecker , Chris Mason , Arjan van de Ven , rt@linutronix.de, Rik van Riel , Linus Torvalds , George Spelvin , Len Brown , ltp@lists.linux.it Subject: Re: [patch V2 00/20] timer: Refactor the timer wheel Message-ID: <20160626200248.GA11518@amd> References: <20160617121134.417319325@linutronix.de> <1466581044.3188.34.camel@gmail.com> <20160626190025.GC11162@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! On Sun 2016-06-26 12:21:46, Arjan van de Ven wrote: > On Sun, Jun 26, 2016 at 12:00 PM, Pavel Machek wrote: > > > > Umm. I'm not sure if you should be designing kernel... > > > > I have alarm clock application. It does sleep(60) many times till its > > time to wake me up. I'll be very angry if sleep(60) takes 65 seconds > > without some very, very good reason. > > I'm fairly sure you shouldn't be designing alarm clock applications! > Because on busy systems you get random (scheduler) delays added to >your timer. I'm pretty sure I should not be designing alarm clock applications, after looking at the timezone stuff. But alarm clock from mate eats 3% cpu at my cellphone, so I kind of had to. And yes, I'm aware that scheduler delays would add up. But if it is 79 seconds before alarm, I do sleep(79), and it would be strange to have alarm fire 5 seconds too late. > Having said that, your example is completely crooked here, sleep() > does not use these kernel timers, it uses hrtimers instead. > (hrtimers also have slack, but an alarm clock application that is this > broken would have the choice to set such slack to 0) > > What happened here is that these sigtimewait were actually not great, > it is just about the only application visible interface that's still > in jiffies/HZ, > and in the follow-on patch set, Thomas converted them properly to > hrtimers as well to make them both accurate and CONFIG_HZ > independent. So it is going to be fixed, good. Best regards, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html