From: Thomas Gleixner <tglx@linutronix.de>
To: Kyle Moffett <kyle@moffetthome.net>
Cc: Alexander Shishkin <virtuoso@slind.org>,
LKML <linux-kernel@vger.kernel.org>,
John Stultz <johnstul@us.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Kay Sievers <kay.sievers@vrfy.org>, Greg KH <gregkh@suse.de>,
Chris Friesen <chris.friesen@genband.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCHv5 0/7] system time changes notification
Date: Fri, 17 Sep 2010 15:52:03 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.00.1009171518500.2416@localhost6.localdomain6> (raw)
In-Reply-To: <AANLkTin2T3XX0b5ezzCvLvQiu0qg_KWfTSTaATHZmMk=@mail.gmail.com>
On Fri, 17 Sep 2010, Kyle Moffett wrote:
> On Fri, Sep 17, 2010 at 08:57, Thomas Gleixner <tglx@linutronix.de> wrote:
>
> > On Fri, 17 Sep 2010, Alexander Shishkin wrote:
> > > 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
> >
>
> This still doesn't help with the specified use-case. For example, consider
> the case of configuring my crontab to run a command every day at 2PM.
>
> Let's assume that I then start the cron daemon at 2:05PM, and it establishes
> an absolute timer at 2PM the following day.
>
> I then realize that the clock is wrong, and correct it to read 1:55PM.
>
> The problem is... cron's timer is still set to trigger at 2PM *tomorrow*,
> instead of being readjusted at the time the clock is changed to go off at
> 2PM *today*.
>
> Right now there's really no way to fix that other than polling every so
> often to recheck the system time is what you expect.
Hmm, ok.
So what you really want is a timer which drops back to user space with
an appropriate error code when something fiddled with the clock.
That's reasonably easy to implement as an extension at least for
clock_nanosleep. For the signal based timers it'd be probably quite
nasty, but doable.
Thanks,
tglx
prev parent reply other threads:[~2010-09-17 13:52 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-16 22:10 Alexander Shishkin
2010-09-16 22:10 ` [PATCH 1/7] notify userspace about time changes Alexander Shishkin
2010-09-16 22:30 ` john stultz
2010-09-16 22:58 ` Alexander Shishkin
2010-09-16 23:15 ` john stultz
2010-09-17 9:29 ` Thomas Gleixner
2010-10-01 13:23 ` Alexander Shishkin
2010-09-17 10:33 ` Alan Cox
2010-09-17 10:22 ` Kay Sievers
2010-09-17 11:08 ` Alexander Shishkin
2010-09-17 11:07 ` Thomas Gleixner
2010-09-16 22:10 ` [PATCH 2/7] wire up sys_time_change_notify() on ARM Alexander Shishkin
2010-09-16 22:10 ` [PATCH 3/7] wire up sys_time_change_notify() on x86 Alexander Shishkin
2010-09-16 22:10 ` [PATCH 4/7] wire up sys_time_change_notify() on powerpc Alexander Shishkin
2010-09-16 22:10 ` [PATCH 5/7] wire up sys_time_change_notify() on blackfin Alexander Shishkin
2010-09-22 7:45 ` Mike Frysinger
2010-09-16 22:10 ` [PATCH 6/7] wire up sys_time_change_notify() on ia64 Alexander Shishkin
2010-09-16 22:10 ` [PATCH 7/7] wire up sys_time_change_notify() on s390 Alexander Shishkin
2010-09-17 12:57 ` [PATCHv5 0/7] system time changes notification Thomas Gleixner
[not found] ` <AANLkTin2T3XX0b5ezzCvLvQiu0qg_KWfTSTaATHZmMk=@mail.gmail.com>
2010-09-17 13:52 ` Thomas Gleixner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.00.1009171518500.2416@localhost6.localdomain6 \
--to=tglx@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=chris.friesen@genband.com \
--cc=gregkh@suse.de \
--cc=hpa@zytor.com \
--cc=johnstul@us.ibm.com \
--cc=kay.sievers@vrfy.org \
--cc=kirill@shutemov.name \
--cc=kyle@moffetthome.net \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=virtuoso@slind.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®