Re: [PATCH] Revised timerfd() interface

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Davide Libenzi <davidel@...>
Cc: <akpm@...>, <corbet@...>, <jengelh@...>, <hch@...>, <stable@...>, <drepper@...>, <torvalds@...>, <linux-kernel@...>, <tglx@...>, <rdunlap@...>
Date: Thursday, September 6, 2007 - 2:58 am

Hi Davide,

                                       ^
(By the way, I assume that back there, there was a missing "not",
right?)


You are asserting this in the face of two previous APIs designed 
by people who (at least in the case of POSIX timers) probably 
thoroughly examined and discussed existing APIs and practice.


I'm not sure what problem this code is supposed to solve.  It
doesn't solve the problem I have in mind; see below.


This function is *not at all* equivalent to the "get"
functionality of the previous APIs.  The "get" functionality
of POSIX timers (for example) returns a structure that contains
the timer interval and the *time until the next expiration of
the timer* (not the initial timer string, as your code above
does).

So come up with a reliable, race-free way of doing that in
userspace.  Then make it work for both CLOCK_MONOTONIC and
CLOCK_REALTIME timers.  (You'll certainly need to be making
some additional system calls, by the way: at least some
calls to clock_gettime().)


See my comments above in this message.  You may doubt it, but
all of the earlier API designers did not.


No!  In the example I described the library is able to create and
control exactly *one* timerfd file descriptor.  It wants to hand
that fd back to the application and then perform arbitrary
manipulations of the timer's settings.  Meanwhile the application
needs to (repeatedly) monitor that one file descriptor in a
select()/poll()/epoll() (and so the library can't just arbitrarily
create further file descriptors).


You have not demonstrated this ;-).  Your userspace code does
not solve the problem.

Best regards,

Michael
-- 
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7 

Want to help with man page maintenance?  
Grab the latest tarball at
http://www.kernel.org/pub/linux/docs/manpages , 
read the HOWTOHELP file and grep the source 
files for 'FIXME'.

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

Messages in current thread:
Re: [PATCH] Revised timerfd() interface, Michael Kerrisk, (Sat Aug 25, 2:41 am)
Re: [PATCH] Revised timerfd() interface, Davide Libenzi, (Thu Aug 30, 8:01 am)
Re: [PATCH] Revised timerfd() interface, Michael Kerrisk, (Tue Sep 4, 4:03 am)
Re: [PATCH] Revised timerfd() interface, Andrew Morton, (Tue Sep 4, 4:18 am)
Re: [PATCH] Revised timerfd() interface, Davide Libenzi, (Tue Sep 4, 11:25 am)
Re: [PATCH] Revised timerfd() interface, Denys Vlasenko, (Wed Sep 5, 8:12 am)
timerfd redux, Michael Kerrisk, (Wed Sep 5, 11:32 am)
Re: timerfd redux, Andrew Morton, (Wed Sep 12, 10:39 pm)
Re: timerfd redux, Michael Kerrisk, (Thu Sep 13, 4:13 am)
Re: timerfd redux, Andrew Morton, (Thu Sep 13, 4:20 am)
Re: timerfd redux, Michael Kerrisk, (Thu Sep 13, 2:14 am)
Re: [PATCH] Revised timerfd() interface, Michael Kerrisk, (Tue Sep 4, 4:49 pm)
Re: [PATCH] Revised timerfd() interface, Davide Libenzi, (Tue Sep 4, 6:44 pm)
Re: [PATCH] Revised timerfd() interface, Michael Kerrisk, (Tue Sep 4, 8:08 pm)
Re: [PATCH] Revised timerfd() interface, Davide Libenzi, (Wed Sep 5, 12:14 pm)
Re: [PATCH] Revised timerfd() interface, Michael Kerrisk, (Wed Sep 5, 12:23 pm)
Re: [PATCH] Revised timerfd() interface, Davide Libenzi, (Wed Sep 5, 3:57 pm)
Re: [PATCH] Revised timerfd() interface, Michael Kerrisk, (Wed Sep 5, 6:50 pm)
Re: [PATCH] Revised timerfd() interface, Davide Libenzi, (Wed Sep 5, 7:45 pm)
Re: [PATCH] Revised timerfd() interface, Michael Kerrisk, (Thu Sep 6, 2:58 am)
Re: [PATCH] Revised timerfd() interface, Davide Libenzi, (Thu Sep 6, 7:37 pm)
Re: [PATCH] Revised timerfd() interface, Michael Kerrisk, (Sun Sep 9, 11:15 pm)
Re: [PATCH] Revised timerfd() interface, Andrew Morton, (Wed Sep 5, 8:02 am)
Re: [PATCH] Revised timerfd() interface, Michael Kerrisk, (Tue Sep 4, 11:39 am)
Re: [PATCH] Revised timerfd() interface, Davide Libenzi, (Tue Sep 4, 6:41 pm)
Re: [PATCH] Revised timerfd() interface, Michael Kerrisk, (Tue Sep 4, 4:24 am)