[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1009171452270.2416@localhost6.localdomain6>
Date: Fri, 17 Sep 2010 14:57:41 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Alexander Shishkin <virtuoso@...nd.org>
cc: LKML <linux-kernel@...r.kernel.org>,
John Stultz <johnstul@...ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"H. Peter Anvin" <hpa@...or.com>,
Kay Sievers <kay.sievers@...y.org>, Greg KH <gregkh@...e.de>,
Chris Friesen <chris.friesen@...band.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"Kirill A. Shutemov" <kirill@...temov.name>,
Alan Cox <alan@...rguk.ukuu.org.uk>
Subject: Re: [PATCHv5 0/7] system time changes notification
On Fri, 17 Sep 2010, Alexander Shishkin wrote:
> Hi,
>
> This is the fifth version of system time change notification mechanism
> for linux kernel. The need for it comes from applications which would
> like to keep track of time changes without having to wake up every
> $TIMEOUT and calling gettimeofday().
>
> An excellent description for one of the usecases, written by Kay Sievers
> (http://kerneltrap.org/mailarchive/linux-kernel/2010/8/5/4603531):
> """
> This is the example Lennart and I thought about when we considered
> adding cron-like stuff to systemd's timer configs, but didn't want to
> do silly things like scheduled checks for the actual time, so we
> delayed this feature until such a notification becomes available.
>
> Consider we want stuff like "wakeup every day at 3pm", the next wakeup
> might be earlier than the timer we calculated last time, on system
> time changes. We need to re-calculate it. This is necessary for all
> repeating events.
>
> Say we want to wakeup at 3pm, now it's 4pm, so we schedule it in 23
> hours. Now the system time changes to 2pm, and we would expect to
> wakeup in one hour, but we take 25.
And that's why we have posix-timers with the ability to arm absolute
timers. They already deal with the clock being set.
man timer_settime
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists