Re: RFC: A revised timerfd API

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Michael Kerrisk <mtk-manpages@...>
Cc: Davide Libenzi <davidel@...>, Ulrich Drepper <drepper@...>, <geoff@...>, lkml <linux-kernel@...>, Andrew Morton <akpm@...>, Christoph Hellwig <hch@...>, Jonathan Corbet <corbet@...>, Randy Dunlap <rdunlap@...>, <vda.linux@...>, Linus Torvalds <torvalds@...>, Lee Schermerhorn <Lee.Schermerhorn@...>
Date: Tuesday, September 18, 2007 - 5:10 am

Michael,

On Tue, 2007-09-18 at 09:30 +0200, Michael Kerrisk wrote:

I agree. It's ugly.


I'm not scared by the 3 system calls. I rather fear that we end up
reimplementing half of the existing posix timer code.


The main problem here is, that there is no way to tell the posix timer
code that the delivery of the timer is through the file descriptor and
not via the usual posix timer mechanisms. We need something like the
SIGEV_TIMERFD flag to make the posix timer code aware of that.


What happens on close(fd) ? Is the posix timer automatically destroyed ?
Is the file descriptor invalidated when the timer is destroyed via
timer_delete(timer_id) ? The automatic file descriptor creation is a bit
ugly.

I'd rather see a combination of c) and d) as a solution:

Notify the posix timer code that the timer delivery is done via the file
descriptor mechanism (SIGEV_TIMERFD). 

Use a new syscall to open a file descriptor on that timer. 

When the file descriptor is closed the timer is not destroyed, but
delivery disabled (analogous to the SIGEV_NONE case), so you can reopen
and reactivate it later on.

This way we have it nicely integrated into the posix timer code and keep
the existing semantics of posix timers intact.

We need to think about the open file descriptor in the timer_delete()
case as well, but this should be not too hard to sort out.

	tglx




-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
RFC: A revised timerfd API, Michael Kerrisk, (Tue Sep 18, 3:27 am)
Re: RFC: A revised timerfd API, Davide Libenzi, (Tue Sep 18, 12:51 pm)
Re: RFC: A revised timerfd API, Michael Kerrisk, (Sat Sep 22, 9:12 am)
Re: RFC: A revised timerfd API, Davide Libenzi, (Sat Sep 22, 5:07 pm)
Re: RFC: A revised timerfd API, Michael Kerrisk, (Sun Sep 23, 1:33 pm)
Re: RFC: A revised timerfd API, Davide Libenzi, (Sun Sep 23, 2:33 pm)
Re: RFC: A revised timerfd API, Davide Libenzi, (Sun Sep 23, 2:41 pm)
Re: RFC: A revised timerfd API, Michael Kerrisk, (Sun Sep 23, 3:03 pm)
Re: RFC: A revised timerfd API, Thomas Gleixner, (Sat Sep 22, 5:26 pm)
Re: RFC: A revised timerfd API, Davide Libenzi, (Sat Sep 22, 7:21 pm)
Re: RFC: A revised timerfd API, Thomas Gleixner, (Sat Sep 22, 1:10 pm)
Re: RFC: A revised timerfd API, Bernd Eckenfels, (Sat Sep 22, 10:32 am)
Re: RFC: A revised timerfd API, Michael Kerrisk, (Sat Sep 22, 12:07 pm)
Re: RFC: A revised timerfd API, David , (Sat Sep 22, 7:37 pm)
Re: RFC: A revised timerfd API, Thomas Gleixner, (Sat Sep 22, 1:05 pm)
Re: RFC: A revised timerfd API, Michael Kerrisk, (Tue Sep 18, 3:30 am)
Re: RFC: A revised timerfd API, Thomas Gleixner, (Tue Sep 18, 5:10 am)
Re: RFC: A revised timerfd API, Michael Kerrisk, (Tue Sep 18, 5:30 am)
Re: RFC: A revised timerfd API, Thomas Gleixner, (Tue Sep 18, 5:42 am)
Re: RFC: A revised timerfd API, Michael Kerrisk, (Tue Sep 18, 7:08 am)
Re: RFC: A revised timerfd API, Thomas Gleixner, (Tue Sep 18, 7:30 am)
Re: RFC: A revised timerfd API, David , (Tue Sep 18, 9:13 am)
Re: RFC: A revised timerfd API, Michael Kerrisk, (Sat Sep 22, 9:03 am)
Re: RFC: A revised timerfd API, David , (Tue Sep 18, 4:05 am)
Re: RFC: A revised timerfd API, Michael Kerrisk, (Tue Sep 18, 5:01 am)
Re: RFC: A revised timerfd API, Thomas Gleixner, (Tue Sep 18, 5:27 am)