Re: [PATCH] [RFCv2] notify userspace about time changes

john stultz
2010-08-18T23:10:12Z

On Wed, 2010-08-18 at 16:55 +0300, Alexander Shishkin wrote:
> Changes since v1:
> - updated against 2.6.36-rc1,
> - added notification/filtering options,
> - added Documentation/ABI/sysfs-kernel-time-notify interface description.
>
> Certain userspace applications (like "clock" desktop applets or cron) might
> want to be notified when some other application changes the system time. It
> might also be important for an application to be able to distinguish between
> its own and somebody else's time changes.
>
> This patch implements a notification interface via eventfd mechanism. Proccess
> wishing to be notified about time changes should create an eventfd and echo
> its file descriptor along with notification options to /sys/kernel/time_notify.
> After that, any calls to settimeofday()/stime()/adjtimex() made by other
> processes will be signalled to this eventfd. Credits for suggesting the eventfd
> mechanism for this purpose go to Kirill Shutemov.

Hey Alexander,
Glad to see this work continue! One thing did strike me as odd in
reading over this: Does adjtimex really make sense to trigger a
notification? Its not actually changing the time, but alters the freq
that time runs. This freq adjustment is transparent to applications or
timers (unlike something like settimeofday). So I'm not sure I see why
it is included here.

What use case did you have in mind for it?

thanks
-john