lkml.org 
[lkml]   [2010]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv6 0/7] system time changes notification
B1;2401;0cOn Thu, 11 Nov 2010, Kyle Moffett wrote:
> On Thu, Nov 11, 2010 at 16:16, Thomas Gleixner <tglx@linutronix.de> wrote:
> > The notification itself is pointless unless your application is
> > dealing with timers which need to be adjusted the one way or the
> > other.
> >
> > That said, I'm still not convinced that this usecase justifies a new
> > systemcall.
> >
> > 1) We can make timers wake up when a clock change happens
> > 2) Can't we use existing notification stuff like uevents or such ?
>
> What about maybe adding device nodes for various kinds of "clock"
> devices? You could then do:
>
> #define CLOCK_FD 0x80000000
> fd = open("/dev/clock/realtime", O_RDWR);
> poll(fd);
> clock_gettime(CLOCK_FD|fd, &ts);

That won't work due to the posix-cputimers occupying the negative
number space already.

> [...]
>
> This would also enable the folks who want to support things like PHY
> hardware clocks (for very-low-latency ethernet timestamping). It
> would resolve the enumeration problem; instead of 0, 1, 2, ... as
> constants, they would show up in sysfs and be open()able. Ideally you
> would be able to set up ntpd to slew the "realtime" clock by following
> a particular hardware clock, or vice versa.

There are other plans for the various interesting clocks floating
around which look pretty good.

But what you folks really want for this stuff is an extension to
timerfd as you want to be able to poll, right?

So what about the following:

Add a new flag TDF_NOTIFY_CLOCK_WAS_SET to the timerfd flags. Now this
flag adds the timer to a separate list, which gets woken up when the
clock is set.

No new syscall, just a few lines of code in fs/timerfd.c and
clock_was_set().

Thoughts ?

tglx


\
 
 \ /
  Last update: 2010-11-11 23:53    [W:0.098 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site