mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Shishkin <virtuoso@slind.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Valdis.Kletnieks@vt.edu, 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>
Subject: Re: [PATCHv6 0/7] system time changes notification
Date: Fri, 12 Nov 2010 14:30:44 +0200	[thread overview]
Message-ID: <20101112123044.GD10585@shisha.kicks-ass.net> (raw)
In-Reply-To: <alpine.LFD.2.00.1011112212460.2900@localhost6.localdomain6>

On Thu, Nov 11, 2010 at 10:16:03PM +0100, Thomas Gleixner wrote:
> B1;2401;0cOn Thu, 11 Nov 2010, Alexander Shishkin wrote:
> 
> > On Thu, Nov 11, 2010 at 03:28:13PM -0500, Valdis.Kletnieks@vt.edu wrote:
> > > On Thu, 11 Nov 2010 21:29:55 +0200, Alexander Shishkin said:
> > > 
> > > > 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.
> > > 
> > > Sorry, I tuned in late here...
> > > 
> > > So the plan is that if you're not using this new interface, it will go off at
> > > the same absolute offset (23 hours after timer was set), but if you're using
> > > this interface, your timer event gets interrupted, you get woken up (say)
> > > 15 hours into your 23, and it's your job to decide if you need to set a
> > > new timer for the remaining 6, 7, 8 hours or some other number?
> > 
> > Yes. This interface doesn't deal with timers, it only provides notifications.
> 
> The notification itself is pointless unless your application is
> dealing with timers which need to be adjusted the one way or the
> other.

Not quite. There are two use cases that I know of that need this notification
but don't use timers like that. One was described by Chris Friesen in the
comments to the first version of this patchset [1]. The other one was
described by me in the same thread [2]. They could, of course start using
timers specifically to get this notification, but I'm not sure if it doesn't
abuse the whole idea of timers.

> That said, I'm still not convinced that this usecase justifies a new
> systemcall.

Well, initially it was a sysfs interface (an arguably ugly one, though).

> 1) We can make timers wake up when a clock change happens

Isn't there a race so that if two clock changes happen in quick succession,
the user might lose the second one while he restarts the timer?

> 2) Can't we use existing notification stuff like uevents or such ?

I thought about that in the beginning but uevents indeed seem too heavy
for this sort of notification, especially compared to eventfds.

[1] http://lkml.org/lkml/2010/8/4/383
[2] http://lkml.org/lkml/2010/8/5/192

Regards,
--
Alex

      parent reply	other threads:[~2010-11-12 12:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-11 19:29 Alexander Shishkin
2010-11-11 19:29 ` [PATCHv6 1/7] notify userspace about time changes Alexander Shishkin
2010-11-11 20:55   ` Arnd Bergmann
2010-11-11 19:29 ` [PATCHv6 2/7] wire up sys_time_change_notify() on ARM Alexander Shishkin
2010-11-11 19:29 ` [PATCHv6 3/7] wire up sys_time_change_notify() on x86 Alexander Shishkin
2010-11-11 19:29 ` [PATCHv6 4/7] wire up sys_time_change_notify() on ia64 Alexander Shishkin
2010-11-11 19:30 ` [PATCHv6 5/7] wire up sys_time_change_notify() on s390 Alexander Shishkin
2010-11-11 19:30 ` [PATCHv6 6/7] wire up sys_time_change_notify() on powerpc Alexander Shishkin
2010-11-11 19:30 ` [PATCHv6 7/7] wire up sys_time_change_notify() on blackfin Alexander Shishkin
2010-11-11 20:28 ` [PATCHv6 0/7] system time changes notification Valdis.Kletnieks
2010-11-11 20:51   ` Alexander Shishkin
2010-11-11 21:16     ` Thomas Gleixner
2010-11-11 22:11       ` Kyle Moffett
2010-11-11 22:36         ` john stultz
2010-11-11 23:19           ` Kyle Moffett
2010-11-11 23:41             ` john stultz
2010-11-11 23:45             ` john stultz
2010-11-11 22:50         ` Thomas Gleixner
2010-11-12  2:35           ` Davide Libenzi
2010-11-17 19:06           ` Alexander Shishkin
2010-11-17 20:42             ` Davide Libenzi
2010-11-17 21:29               ` Alexander Shishkin
2010-11-17 21:34                 ` Kay Sievers
2010-11-18 15:59                   ` Alexander Shishkin
2010-11-17 21:46                 ` Thomas Gleixner
2010-11-18  9:49                   ` Alexander Shishkin
2010-11-18 13:08               ` Artem Bityutskiy
2010-11-12  9:25         ` Alan Cox
2010-11-12 10:53           ` Richard Cochran
2010-11-12 11:25             ` Alan Cox
2010-11-12 10:47       ` Kay Sievers
2010-11-12 12:30       ` Alexander Shishkin [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=20101112123044.GD10585@shisha.kicks-ass.net \
    --to=virtuoso@slind.org \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=akpm@linux-foundation.org \
    --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=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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

Powered by JetHome