Re: [PATCH 4/4] timers: posix interface for alarm-timers

From: John Stultz
Date: Thu Apr 21 2011 - 14:20:20 EST


On Wed, 2011-04-20 at 08:34 +0200, Richard Cochran wrote:
> On Tue, Apr 19, 2011 at 04:58:30PM -0700, John Stultz wrote:
> > This patch exposes alarm-timers to userland via the posix clock
> > and timers interface, using two new clockids: CLOCK_REALTIME_ALARM
> > and CLOCK_BOOTTIME_ALARM. Both clockids behave identically to
> > CLOCK_REALTIME and CLOCK_BOOTTIME, respectively, but timers
> > set against the _ALARM suffixed clockids will wake the system if
> > it is suspended.
>
> So, is there reason these cannot or should not be using the dynamic
> posix clock interface?

So in this case, since the clockids are not directly linked to specific
dynamic hardware, I'm not sure if that's the best route.

> > The semantics of the Android alarm driver are different from what
> > this posix interface provides.
> ...
> > One potential way to implement similar semantics may be via
> > the timerfd infrastructure, but this needs more research.
> >
> > There may also need to be some sort of sysfs system level policy
> > hooks that allow alarm timers to be disabled to keep them
> > from firing at inappropriate times (ie: laptop in a well insulated
> > bag, mid-flight).
>
> I have not put hardly any thought into these issues, but the dynamic
> interface gives you a character device at no extra charge.

True, but I'd like to first try to extend the existing interface
(timerfd) before we look at adding new ones.

thanks
-john


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/