linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv6 0/7] system time changes notification
@ 2010-11-11 19:29 Alexander Shishkin
  2010-11-11 19:29 ` [PATCHv6 1/7] notify userspace about time changes Alexander Shishkin
                   ` (7 more replies)
  0 siblings, 8 replies; 32+ messages in thread
From: Alexander Shishkin @ 2010-11-11 19:29 UTC (permalink / raw)
  To: linux-kernel
  Cc: John Stultz, Andrew Morton, H. Peter Anvin, Kay Sievers, Greg KH,
	Chris Friesen, Linus Torvalds, Kirill A. Shutemov,
	Thomas Gleixner, Alexander Shishkin

Hi,

This is the sixth 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.
"""

Changes since v5:
 - addressed Thomas Gleixner's comments
 - added clockid syscall parameter as suggested by John Stultz
 - updated powerpc and blackfin syscalls
Changes since v4:
 - updated arm and s390 syscall wiring
 - removed RFC
Changes since v3:
 - broken out separate patches adding time_change_notify syscall to
   arm, powerpc, x86, ia64, s390 and blackfin
Changes since v2:
 - replaced sysfs interface with a syscall
 - added sysctl/procfs handle to set a limit to the number of users
 - fixed issues pointed out by Greg.
Changes since v1:
 - updated against 2.6.36-rc1,
 - added notification/filtering options,
 - added Documentation/ABI/sysfs-kernel-time-notify interface description.

Alexander Shishkin (7):
      notify userspace about time changes
      wire up sys_time_change_notify() on ARM
      wire up sys_time_change_notify() on x86
      wire up sys_time_change_notify() on ia64
      wire up sys_time_change_notify() on s390
      wire up sys_time_change_notify() on powerpc
      wire up sys_time_change_notify() on blackfin

 Documentation/time-change-notify-example.c |   65 +++++++++++
 arch/arm/include/asm/unistd.h              |    1 +
 arch/arm/kernel/calls.S                    |    1 +
 arch/blackfin/include/asm/unistd.h         |    3 +-
 arch/blackfin/mach-common/entry.S          |    1 +
 arch/ia64/include/asm/unistd.h             |    3 +-
 arch/ia64/kernel/entry.S                   |    1 +
 arch/powerpc/include/asm/systbl.h          |    1 +
 arch/powerpc/include/asm/unistd.h          |    3 +-
 arch/s390/include/asm/unistd.h             |    3 +-
 arch/s390/kernel/compat_wrapper.S          |    7 ++
 arch/s390/kernel/syscalls.S                |    1 +
 arch/x86/ia32/ia32entry.S                  |    1 +
 arch/x86/include/asm/unistd_32.h           |    3 +-
 arch/x86/include/asm/unistd_64.h           |    2 +
 arch/x86/kernel/syscall_table_32.S         |    1 +
 include/asm-generic/unistd.h               |    4 +-
 include/linux/syscalls.h                   |    2 +
 include/linux/time.h                       |   13 +++
 kernel/sys_ni.c                            |    3 +
 kernel/time/Kconfig                        |    7 ++
 kernel/time/Makefile                       |    1 +
 kernel/time/notify.c                       |  163 ++++++++++++++++++++++++++++
 kernel/time/ntp.c                          |    3 +
 kernel/time/timekeeping.c                  |    3 +
 25 files changed, 290 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/time-change-notify-example.c
 create mode 100644 kernel/time/notify.c

Regards,
--
Alex

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2010-11-18 15:59 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-11 19:29 [PATCHv6 0/7] system time changes notification 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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).