public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: Alexander Shishkin <virtuoso@slind.org>
Cc: linux-kernel@vger.kernel.org,
	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>,
	Thomas Gleixner <tglx@linutronix.de>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Jon Hunter <jon-hunter@ti.com>, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	David Howells <dhowells@redhat.com>, Avi Kivity <avi@redhat.com>,
	John Kacur <jkacur@redhat.com>
Subject: Re: [PATCH 1/7] notify userspace about time changes
Date: Thu, 16 Sep 2010 16:15:12 -0700	[thread overview]
Message-ID: <1284678912.2669.92.camel@localhost.localdomain> (raw)
In-Reply-To: <20100916225843.GB10463@shisha.kicks-ass.net>

On Fri, 2010-09-17 at 01:58 +0300, Alexander Shishkin wrote:
> On Thu, Sep 16, 2010 at 03:30:40 -0700, john stultz wrote:
> > On Fri, 2010-09-17 at 01:10 +0300, Alexander Shishkin wrote:
> > > 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 pass it
> > > to time_change_notify() syscall along with notification options.
> > > 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.
> > 
> > One thing I have thought of since the last time you posted this, maybe
> > it would be worth adding a clockid field to the syscall?
> > 
> > Basically, we're looking at extending the posix clocks interfaces to
> > allow for additional clock hardware to be exposed (See the discussion on
> > PTP and my CLOCK_RTC patch today for examples and details).
> > 
> > So it seems possible that folks would want a similar interface to catch
> > updates to non CLOCK_REALTIME clocks.
> > 
> > Does this seem reasonable?
> 
> The whole idea seems interesting, I'll try to add this in the next iteration
> of this patchset.

Very cool!

> The first thing that comes it mind is -- are there going to be additional
> events that the user might like to be notified of, like rtc_set_alarm()?
> Doesn't seem too likely, though.

Well, the posix interface patch is trying to abstract over the hardware
details like rtc_set_alarm.

So instead it would be timer_create/timer_settime/etc. These interfaces
deal with timer structures that are per-process, so I don't think we
need a notification hook for them.

thanks
-john





  reply	other threads:[~2010-09-16 23:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-16 22:10 [PATCHv5 0/7] system time changes notification 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 [this message]
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

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=1284678912.2669.92.camel@localhost.localdomain \
    --to=johnstul@us.ibm.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=avi@redhat.com \
    --cc=chris.friesen@genband.com \
    --cc=dhowells@redhat.com \
    --cc=gregkh@suse.de \
    --cc=hpa@zytor.com \
    --cc=jkacur@redhat.com \
    --cc=jon-hunter@ti.com \
    --cc=kay.sievers@vrfy.org \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=tglx@linutronix.de \
    --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