<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns="http://purl.org/rss/1.0/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"
>

  <channel rdf:about="http://lwn.net/headlines/245533/">
    <title>LWN: Comments on "timerfd() and system call review"</title>
    <link>http://lwn.net/Articles/245533/</link>
    <description>
This is a special feed containing comments posted
to the individual LWN article titled &quot;timerfd() and system call review&quot;.

    </description>

    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>2</syn:updateFrequency>
    <items>
      <rdf:Seq>
	<rdf:li resource="http://lwn.net/Articles/251576/rss" />
	<rdf:li resource="http://lwn.net/Articles/247590/rss" />
	<rdf:li resource="http://lwn.net/Articles/247588/rss" />
	<rdf:li resource="http://lwn.net/Articles/247171/rss" />
	<rdf:li resource="http://lwn.net/Articles/247113/rss" />
	<rdf:li resource="http://lwn.net/Articles/246094/rss" />
	<rdf:li resource="http://lwn.net/Articles/246091/rss" />
	<rdf:li resource="http://lwn.net/Articles/246090/rss" />
	<rdf:li resource="http://lwn.net/Articles/246070/rss" />
	<rdf:li resource="http://lwn.net/Articles/246069/rss" />
	<rdf:li resource="http://lwn.net/Articles/246047/rss" />
	<rdf:li resource="http://lwn.net/Articles/246046/rss" />
	<rdf:li resource="http://lwn.net/Articles/246043/rss" />
	<rdf:li resource="http://lwn.net/Articles/246042/rss" />
	<rdf:li resource="http://lwn.net/Articles/245944/rss" />
	<rdf:li resource="http://lwn.net/Articles/245896/rss" />
	<rdf:li resource="http://lwn.net/Articles/245878/rss" />
	<rdf:li resource="http://lwn.net/Articles/245791/rss" />
	<rdf:li resource="http://lwn.net/Articles/245763/rss" />
	<rdf:li resource="http://lwn.net/Articles/245761/rss" />
	<rdf:li resource="http://lwn.net/Articles/245758/rss" />
	<rdf:li resource="http://lwn.net/Articles/245757/rss" />
	<rdf:li resource="http://lwn.net/Articles/245745/rss" />
	<rdf:li resource="http://lwn.net/Articles/245712/rss" />
	<rdf:li resource="http://lwn.net/Articles/245688/rss" />
	<rdf:li resource="http://lwn.net/Articles/245668/rss" />
	<rdf:li resource="http://lwn.net/Articles/245663/rss" />
	<rdf:li resource="http://lwn.net/Articles/245645/rss" />
	<rdf:li resource="http://lwn.net/Articles/245634/rss" />
	<rdf:li resource="http://lwn.net/Articles/245621/rss" />
	<rdf:li resource="http://lwn.net/Articles/245620/rss" />
	<rdf:li resource="http://lwn.net/Articles/245619/rss" />
	<rdf:li resource="http://lwn.net/Articles/245616/rss" />
	<rdf:li resource="http://lwn.net/Articles/245599/rss" />
	<rdf:li resource="http://lwn.net/Articles/245578/rss" />
	<rdf:li resource="http://lwn.net/Articles/245574/rss" />
	<rdf:li resource="http://lwn.net/Articles/245570/rss" />
	<rdf:li resource="http://lwn.net/Articles/245569/rss" />
      
      </rdf:Seq>
    </items>

  </channel>
    <item rdf:about="http://lwn.net/Articles/251576/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/251576/rss</link>
      <dc:date>2007-09-26T06:27:18+00:00</dc:date>
      <dc:creator>ury</dc:creator>
      <description>
      why not just open(&quot;/proc/sys/timerfd...&quot;, .. ) or some similar &lt;br&gt;
to create timerfd descriptor?&lt;br&gt;
&lt;p&gt;
maybe some ioctl can be used to control timer (or sysfs )&lt;br&gt;
&lt;p&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/247590/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/247590/rss</link>
      <dc:date>2007-08-30T23:23:48+00:00</dc:date>
      <dc:creator>nix</dc:creator>
      <description>
      Plan 9 has `notes' instead of signals, but it looks like they too were &lt;br&gt;
`call this function automatically' things rather than being reified into &lt;br&gt;
fds. Surprising. (However, notes are plan9ish in another way: they're &lt;br&gt;
strings, not integers.)&lt;br&gt;
&lt;p&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/247588/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/247588/rss</link>
      <dc:date>2007-08-30T23:19:56+00:00</dc:date>
      <dc:creator>nix</dc:creator>
      <description>
      Actually I'd expect this to be mostly used by libraries. Currently &lt;br&gt;
libraries have the problem that signal disposition is process-global and &lt;br&gt;
can't be reset without interfering with other libraries, which is &lt;br&gt;
ameliorated by signalfd. Also, major libraries like glib *can* &lt;br&gt;
realistically include system-dependent code without being too annoying: it &lt;br&gt;
only has to go into glib, rather than into all its users (and glib already &lt;br&gt;
supports some Linux-specific interfaces anyway: indeed in a sense that's &lt;br&gt;
part of its raison d'etre).&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/247171/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/247171/rss</link>
      <dc:date>2007-08-28T21:58:03+00:00</dc:date>
      <dc:creator>renox</dc:creator>
      <description>
      &lt;font class=&quot;QuotedText&quot;&gt;&amp;gt;&amp;gt;And having *everything* be an fd would finally realize one of the goals of the Unix world since its creation :) &amp;lt;&amp;lt;&lt;/font&gt;&lt;br&gt;
&lt;p&gt;
Given that Plan9 has been much more thorough than Unix in the 'everything is a file' way, I wonder how they solved this issue?&lt;br&gt;
&lt;p&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/247113/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/247113/rss</link>
      <dc:date>2007-08-28T17:31:36+00:00</dc:date>
      <dc:creator>efexis</dc:creator>
      <description>
      So you have a ratification process, where the next (or next+1) release either ratifies the API and it becomes 'stable', alters it (and it remains 'experimental'), or removes it. This stops anything sitting in the experimental state for too long, as developers have to make the improvements or formalise it to keep it in the kernel.&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/246094/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/246094/rss</link>
      <dc:date>2007-08-20T08:25:05+00:00</dc:date>
      <dc:creator>michaelk</dc:creator>
      <description>
      I'm open to suggestions about specific pages in &lt;em&gt;man-pages&lt;/em&gt; that need non-trivial example programs.  (Over time an increasing number of example programs have been added.)
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/246091/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/246091/rss</link>
      <dc:date>2007-08-20T05:20:43+00:00</dc:date>
      <dc:creator>landley</dc:creator>
      <description>
      You didn't follow the saga of my attempts to document the subset of sysfs &lt;br&gt;
used to populate /dev.  Responses I got included:&lt;br&gt;
&lt;p&gt;
A) Contradictory information from different developers.&lt;br&gt;
B) Corrections consisting of &quot;that's wrong&quot; with no hint about the &lt;br&gt;
approved way to do it.&lt;br&gt;
C) Being repeatedly told I was an idiot and not worth their time.&lt;br&gt;
D) Questioning why anyone would want to document this when someone's &lt;br&gt;
already written a program using it.&lt;br&gt;
E) Being repeatedly told &quot;there is no stable API&quot;, I.E. outright &lt;br&gt;
resistance to documenting this area because they didn't want to lose the &lt;br&gt;
freedom to change it on a whim.&lt;br&gt;
&lt;p&gt;
I also got some useful information, but both of the developers I need to &lt;br&gt;
talk to are essentially spam-blocking me now.  Oh well.&lt;br&gt;
&lt;p&gt;
Also, although development and debugging parallelize just fine, editorial &lt;br&gt;
functions don't.  This is why you generally don't have multiple &lt;br&gt;
maintainers whose jurisdictions overlap unless there's a clear hierarchy &lt;br&gt;
of who reports to who.  Writing documentation to be read by end users has &lt;br&gt;
a significant editorial function.&lt;br&gt;
&lt;p&gt;
Rob&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/246090/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/246090/rss</link>
      <dc:date>2007-08-20T05:08:18+00:00</dc:date>
      <dc:creator>landley</dc:creator>
      <description>
      I could see a separate API list, for discussing JUST API issues and not &lt;br&gt;
implementation, which stuff could get cc'd to the way I cc stuff to &lt;br&gt;
linux-doc.  (Things just get buried and lost on linux-kernel.)&lt;br&gt;
&lt;p&gt;
But adding more layers of bureaucracy seldom improves a process, and &lt;br&gt;
inflicting bureaucracy on volunteers makes them go away.  (We added &lt;br&gt;
signed-off-by for _tracking_ purposes, in response to a clear and present &lt;br&gt;
danger the nature of which was a lawsuit.)&lt;br&gt;
&lt;p&gt;
Adding additional layers of verification and certification before &lt;br&gt;
something can be merged is never how Linux has done stuff.  Linus still &lt;br&gt;
accepts some patches directly, when you can get his attention...&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/246070/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/246070/rss</link>
      <dc:date>2007-08-19T07:52:15+00:00</dc:date>
      <dc:creator>michaelk</dc:creator>
      <description>
      I doubt that timeouts are enough.  Too many things just get by because no-one notices (in time).
&lt;p&gt;
By a formalized process, I was suggesting something like a sign-off from one (or preferably more) individuals who might not necessarily be kernel developers, but must be well versed in the Unix system call APIs, who would 
&lt;p&gt;
&lt;ol&gt;
&lt;li&gt;
Consider the design of the API, in particular aspects such as: 
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Generality&lt;/strong&gt; of the design: is it too tailored towards a single purpose? could it be generalized to suit a wider range of uses?
&lt;li&gt;
&lt;strong&gt;Simplicity&lt;/strong&gt;; e.g., is the API overly complex? Complexity often hints at bad design.
&lt;li&gt;
&lt;strong&gt;Consistency&lt;/strong&gt; with similar APIs; e.g., if this API takes similar arguments to an existing API, does it interpret them in a similar way to that API? (This might seem obvious, but there are certainly some glaring examples where new Linux syscalls have failed to follow this simple idea.) 
&lt;li&gt;
&lt;strong&gt;Integration&lt;/strong&gt; with existing APIs; e.g., could this API perhaps be better written as something that leverages existing features of the existing system call API?  
&lt;em&gt;timerfd()&lt;/em&gt; is an interesting case in point.
One of the things I have now begun to wonder is whether it would be feasible to have tight integration of timerfd with the POSIX timers API, so that all that is required is a simplified &lt;em&gt;timerfd()&lt;/em&gt; call that takes only a clockid argument and creates a timerfd descriptor and returns a &lt;em&gt;timer_t *&lt;/em&gt; which is then manipulated using the traditional &lt;em&gt;timer_settimer()&lt;/em&gt;, &lt;em&gt;timer_gettimer()&lt;/em&gt;, etc.
&lt;/ul&gt;
&lt;li&gt;
Verify that the API had undergone sufficient testing, either by examining the coverage of the test programs provided by the API developer, or by writing programs of their own (in fact I'd say the later is in any case necessary).
&lt;li&gt;
Verify that the API has been well documented, either by the developer, or by third parties (working in collaboration with the developer).
&lt;/ol&gt;

      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/246069/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/246069/rss</link>
      <dc:date>2007-08-19T07:09:50+00:00</dc:date>
      <dc:creator>michaelk</dc:creator>
      <description>
      &lt;em&gt;
1) Before a third party can document an API, they have to learn how to
use it, which is a chicken and egg problem (especially if you're trying
to be thorough). If nothing else it's insanely time consuming.
&lt;/em&gt;
&lt;p&gt;
Doing it that way would be.  Obviously efficiently written documentation needs to be collaborative, either written by the developer, and improved via critique from peers and/or individuals well versed in writing documentation, or written by a third party with help from the developer, who explains the API.
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/246047/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/246047/rss</link>
      <dc:date>2007-08-18T18:19:16+00:00</dc:date>
      <dc:creator>landley</dc:creator>
      <description>
      Don't confuse formalizing with automating.  Adding bureaucratic &lt;br&gt;
procedures to collaborative volunteer development really doesn't improve &lt;br&gt;
matters.  (You can't do this unless you've filled in the proper forms.  &lt;br&gt;
Isn't this a fun hobby?)&lt;br&gt;
&lt;p&gt;
Having infrastructure so that something automatically times out if not &lt;br&gt;
dealt with, and people can check what timeouts are pending, that might &lt;br&gt;
help.&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/246046/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/246046/rss</link>
      <dc:date>2007-08-18T18:16:59+00:00</dc:date>
      <dc:creator>landley</dc:creator>
      <description>
      Two points:&lt;br&gt;
&lt;p&gt;
1) Before a third party can document an API, they have to learn how to &lt;br&gt;
use it, which is a chicken and egg problem (especially if you're trying &lt;br&gt;
to be thorough).  If nothing else it's insanely time consuming.&lt;br&gt;
&lt;p&gt;
2) I don't pay much attention to glibc, I pay attention to uClibc.  I'll &lt;br&gt;
happily document what uClibc implements, and ignore the rest because if &lt;br&gt;
uClibc doesn't implement it, it really can't be all that important.&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/246043/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/246043/rss</link>
      <dc:date>2007-08-18T17:34:30+00:00</dc:date>
      <dc:creator>landley</dc:creator>
      <description>
      Which API are you referring to?&lt;br&gt;
&lt;p&gt;
(Someone who writes documentation.)&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/246042/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/246042/rss</link>
      <dc:date>2007-08-18T17:32:55+00:00</dc:date>
      <dc:creator>landley</dc:creator>
      <description>
      &lt;p&gt;Since I have an interest in this documentation stuff I thought I'd see 
if 
&lt;a 
href=http://linux-foundation.org/weblogs/press/2007/04/30/linux-foundation-announces-open-source-developer-travel-fund/&gt;this 
travel fund&lt;/a&gt; might be willing to send me to Cambridge (or failing that 
get some cheap tickets through the University of Texas).  Unfortunately, 
the &lt;a href=http://www.usenix.org/events/kernel07/&gt;summit's website&lt;/a&gt; 
says &quot;Participation in the summit is by invitation only&quot;.&lt;/p&gt;

&lt;p&gt;What's the point of telling us about an event we can't attend?  If we 
were invited, presumably we'd get emails about the schedule...&lt;/p&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245944/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245944/rss</link>
      <dc:date>2007-08-17T17:40:36+00:00</dc:date>
      <dc:creator>giraffedata</dc:creator>
      <description>
      &lt;p&gt;I agree.  If you have a &quot;We're not committed to this and don't stand behind it yet&quot; status, things stay in that status a long time and then there's no distinction between function in that status and not.
&lt;p&gt;
I think it should be like the 5-second rule for reclaiming food dropped on the floor.  You have one release to change your mind and redo a user interface before it becomes set in stone.
&lt;p&gt;
The effectiveness of that would depend entirely upon how well the rule can be communicated to users.

      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245896/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245896/rss</link>
      <dc:date>2007-08-17T11:49:22+00:00</dc:date>
      <dc:creator>Octavian</dc:creator>
      <description>
      &lt;font class=&quot;QuotedText&quot;&gt;&amp;gt; Why is this going into the kernel? It is trivial to achieve the same effect in userspace with pipe() and a thread sleeping in pthread_cond_timedwait().&lt;/font&gt;&lt;br&gt;
&lt;p&gt;
The pipe() mechanism to achieve synchr. timer events wrt epoll()/select() are considered a 'trick' I suppose (which I've used in my own projects too).  So, in the end we do not need to remember this trick at least, that's an achievement.&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245878/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245878/rss</link>
      <dc:date>2007-08-17T09:01:16+00:00</dc:date>
      <dc:creator>addw</dc:creator>
      <description>
      &lt;blockquote&gt;&lt;i&gt;Another way would be to require someone to write a non-trivial program which uses the API to do something useful.&lt;/i&gt;&lt;/blockquote&gt;&lt;p&gt;
&lt;b&gt;And&lt;/b&gt; make that non-trivial program part of the available documentation.&lt;p&gt;
One of the most frustrating things in working with FLOSS is that often (but by no means always) the documentation is awful. It is generally a set of notes written by the author (who entirely understands what it is all about), so someone coming new to the problem has a really hard time getting to see how everything fits together.
&lt;p&gt;
A non-trivial program would be great for system calls; something similar needs to be available for other FLOSS components.
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245791/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245791/rss</link>
      <dc:date>2007-08-16T15:25:08+00:00</dc:date>
      <dc:creator>mrfredsmoothie</dc:creator>
      <description>
      &lt;p&gt;&lt;i&gt;one of the best ways to find shortcomings in an API is to attempt to document it comprehensively.&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Hmmm. Another way would be to require someone to write a non-trivial program which uses the API to do something useful.&lt;/p&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245763/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245763/rss</link>
      <dc:date>2007-08-16T13:20:40+00:00</dc:date>
      <dc:creator>pphaneuf</dc:creator>
      <description>
      &lt;p&gt;The use for &lt;tt&gt;timerfd&lt;/tt&gt; is one of &lt;b&gt;integration&lt;/b&gt;, I think. It's now possible to make an &lt;tt&gt;epoll&lt;/tt&gt; fd, put all of your things in it &lt;em&gt;as well as your timers&lt;/em&gt;, and just give back that single fd to an application, telling it to just call a specific function whenever it becomes readable. Note that in those integration situations (a classical example of which being an asynchronous DNS resolver), you don't get to specify the expiration of the &lt;tt&gt;select&lt;/tt&gt; (or similar) call, or at least, not without complicating the interface.

&lt;p&gt;Of course, it can currently be faked with a thread, either entirely (use a single pipe, and put your whole &lt;tt&gt;select&lt;/tt&gt; loop in a thread, managing the timers as well) or in part (if you have &lt;tt&gt;epoll&lt;/tt&gt;, you can put the fds in it, and use a thread just for the timers). You avoid the race conditions and deadlocks by only doing the minimal amount in the thread, just enough to simulate &lt;tt&gt;epoll&lt;/tt&gt; or &lt;tt&gt;timerfd&lt;/tt&gt;.

&lt;p&gt;What's nice is that with each improvement (&lt;tt&gt;epoll&lt;/tt&gt; and then &lt;tt&gt;timerfd&lt;/tt&gt;), you can make that integration simpler and less complicated (running a thread in the background involves having to deal with untimely termination, making sure to block all signals and other such details). It's also possible to implement the same interface for the application whether you're faking it or not, so you can have some autoconf tests for &lt;tt&gt;epoll&lt;/tt&gt; and &lt;tt&gt;timerfd&lt;/tt&gt;, and then apply the right amount of emulation.

&lt;p&gt;As for the wastefulness, the timer structure is also more or less the same as that &quot;entry&quot; you'd put in a priority queue, and if you use pipes to fake things, you end up having not one, but &lt;em&gt;two&lt;/em&gt; file structures, not to mention an almost entirely useless buffer.
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245761/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245761/rss</link>
      <dc:date>2007-08-16T12:43:40+00:00</dc:date>
      <dc:creator>IkeTo</dc:creator>
      <description>
      &lt;font class=&quot;QuotedText&quot;&gt;&amp;gt; but it's a lot easier to write the userspace code&lt;/font&gt;&lt;br&gt;
&lt;p&gt;
But when &quot;userspace code&quot; means library code, this is going to be hard to sell.  After all the application developer see none of those.  Can you imagine a version of, say, GLib implements its event loop using the timerfd() interface?  Personally I can't.&lt;br&gt;
&lt;p&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245758/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245758/rss</link>
      <dc:date>2007-08-16T11:48:27+00:00</dc:date>
      <dc:creator>nix</dc:creator>
      <description>
      It might be more wasteful, but it's a lot easier to write the userspace &lt;br&gt;
code. Memory is cheap in the quantities we're talking about here (apps &lt;br&gt;
that use millions of timers simultaneously are going to be very rare).&lt;br&gt;
&lt;p&gt;
And having *everything* be an fd would finally realize one of the goals of &lt;br&gt;
the Unix world since its creation :)&lt;br&gt;
&lt;p&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245757/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245757/rss</link>
      <dc:date>2007-08-16T11:45:23+00:00</dc:date>
      <dc:creator>nix</dc:creator>
      <description>
      But a syscall can't easily be used by any applications until it's in glibc &lt;br&gt;
or some other library, and once it is you can't change it because it's &lt;br&gt;
exposed to applications so you can't tell who might be using it.&lt;br&gt;
&lt;p&gt;
(Most of these new syscalls are Linux-specific, anyway, and thus likely to &lt;br&gt;
see comparatively little use outside of abstraction layers like glibc. &lt;br&gt;
POSIX still remains king.)&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245745/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245745/rss</link>
      <dc:date>2007-08-16T10:18:51+00:00</dc:date>
      <dc:creator>IkeTo</dc:creator>
      <description>
      I think the &quot;one thread per timer&quot; might be part of the problem, but not the whole problem.  The bigger part is that to allow programming is such a style, all your events (i.e., wait for input) must signal that condition when the input comes.  What it means is that every fd you wait for must be in its own thread (creating a lot of headaches to prevent race conditions and deadlocks), or else you must use pselect() or epoll() or whatever which subsumes the need for the timer thread anyway.  On the other hand, I still don't quite know what is the best use case of timerfd().  It clearly is geared towards pselect() or epoll().  But that simply replaces the user-mode code to manage the timers by some kernel-mode code to manage the timers via file descriptors.  I can see the kernel-mode approach more wasteful: it requires a timer structure and a file structure for each timer, a userland approach would require just an entry in a priority queue.&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245712/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245712/rss</link>
      <dc:date>2007-08-15T22:34:30+00:00</dc:date>
      <dc:creator>pphaneuf</dc:creator>
      <description>
      My thoughts exactly, except that I'd point out that a &quot;timer signaled over a pipe library&quot; would probably have a single thread, which would use a heap for the timers. Kind of silly, having a thread whose goal is to sleep all the time, basically, but hey, you've got to do what you've got to do...
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245688/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245688/rss</link>
      <dc:date>2007-08-15T19:01:17+00:00</dc:date>
      <dc:creator>njs</dc:creator>
      <description>
      You, uh, want to have one thread per pending timer?&lt;br&gt;
&lt;p&gt;
The real solution avoiding timerfd is to write a proper main loop like the ones in glib, Qt, Twisted Python, libevent, etc., that puts timers on a heap and uses the delay from timer at the head of the heap to set the timeout on one's blocking syscall (select, epoll, kqueue, whatever).&lt;br&gt;
&lt;p&gt;
This is all a truly fantastic pain in the butt, though, esp. once you bring in other events like signals, process handling (waitpid), etc.  Even worse, it's not composable -- if you have libraries that need to do IO, getting them integrated with each other and with your main loop is almost impossible.  Again there are pure-userspace solutions possible in principle (e.g. abstracted wrappers over multiple event loops like liboop), but in practice it remains a huge issue.  This is one of the reasons we still don't have a really decent async dns resolver library, for instance.&lt;br&gt;
&lt;p&gt;
I don't know how much of a help these Linux-specific solutions will be in the long run, but being able to wrap all event sources into fds via timerfd and signalfd and so on, and combine multiple fds into a single fd (for purposes of event selection) via epoll, certainly has the *potential* to simplify all these messes significantly.  Maybe we'll even figure out eventually whether this or kqueue is better.&lt;br&gt;
&lt;p&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245668/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245668/rss</link>
      <dc:date>2007-08-15T16:45:33+00:00</dc:date>
      <dc:creator>davecb</dc:creator>
      <description>
        The Multicians did the whole mutation thing somewhat&lt;br&gt;
better than we do in the Unix world... they tended to&lt;br&gt;
document first, by writing white papers to get their&lt;br&gt;
algorithms discussed.&lt;br&gt;
&lt;p&gt;
  After they delivered,they then froze the parameter&lt;br&gt;
list part of the APIs, but they versions-numbered structures&lt;br&gt;
passed as parameters, so one could &lt;br&gt;
- add new elemnts to the end (a compatable change)&lt;br&gt;
- retire old papameters (version change required), or&lt;br&gt;
- change precision of parameter values (version change required).&lt;br&gt;
&lt;p&gt;
I've used the same trick on Unix/Linux to avoid having to&lt;br&gt;
have &quot;flag days&quot; and allow several of us (Hi, Edsel!) to &lt;br&gt;
develop in parallel, even when we were changing intarfaces&lt;br&gt;
with wild abandon.&lt;br&gt;
&lt;p&gt;
--dave&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245663/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245663/rss</link>
      <dc:date>2007-08-15T16:28:01+00:00</dc:date>
      <dc:creator>khim</dc:creator>
      <description>
      &lt;p&gt;Speed, I presume. Almost anything can done in a userspace (&lt;a href=&quot;http://user-mode-linux.sourceforge.net/&quot;&gt;UML&lt;/a&gt; is a proof), the question is &quot;what does it cost&quot;. Solution with pipe() and thread will be many times slower...&lt;/p&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245645/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245645/rss</link>
      <dc:date>2007-08-15T15:18:37+00:00</dc:date>
      <dc:creator>dougg</dc:creator>
      <description>
      In the 9 years that I have designed, implemented, supported and documented one particular kernel API not one of the thousands of emails that I have received concerning that API was an offer to write documentation.&lt;br&gt;
&lt;p&gt;
I did notice that the glibc folks removed some documentation from the header file that defines the API. I'm not aware that they put that documentation anywhere else. And someone recently noted the discrepancy between the glibc distributed header and the kernel driver header. The solution proposed was to remove the documentation from the driver header as well.&lt;br&gt;
&lt;p&gt;
Now I get to sit back and watch someone else go through a similar process with the bsg driver. And that driver is going to be released with an API that has pending changes (at least 6 months old) held up due to kernel bureaucracy.&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245634/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245634/rss</link>
      <dc:date>2007-08-15T12:20:07+00:00</dc:date>
      <dc:creator>clugstj</dc:creator>
      <description>
      &quot;The purpose of this call is to allow an application to obtain a file descriptor to use with timer events, eliminating the need to use signals.&quot;&lt;br&gt;
&lt;p&gt;
Why is this going into the kernel?  It is trivial to achieve the same effect in userspace with pipe() and a thread sleeping in pthread_cond_timedwait().&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245621/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245621/rss</link>
      <dc:date>2007-08-15T01:58:30+00:00</dc:date>
      <dc:creator>michaelk</dc:creator>
      <description>
      Jon, thanks for the article!  One point not made in the article is that in 2.6.22, the &lt;em&gt;timerfd()&lt;/em&gt; API is broken (this I also discovered while working on the man page).  In 2.6.22, it was intended that &lt;em&gt;read()&lt;/em&gt; from a &lt;em&gt;timerfd()&lt;/em&gt; file descriptor would return a 4-byte value, but a bug meant that only the least significant byte was returned.  So the 2.6.22 interface is in any case unusable.  (The fix for this problem went in with the switch to 8-byte reads.)

&lt;blockquote&gt;
&lt;em&gt;
If the kernel community were to resolve that it would not merge user-space API features in the absence of complete documentation, it might just provide the necessary incentive to get that last review pass done.
&lt;/em&gt;
&lt;/blockquote&gt;
&lt;p&gt;
Given the number of bugs and interface problems I've noticed while developing on man pages, I think this would be a hugely effective step.  This will also be the subject of a &lt;a href=&quot;http://www.linuxconf.eu/2007/programme/abstract-MKerrisk-1.shtml&quot;&gt;presentation that I'll be making at linuxconf.eu&lt;/a&gt;, which precedes this year's Kernel Summit.  Arnd Bergmann will cover some related ground at the conference talking about &lt;a href=&quot;http://www.linuxconf.eu/2007/programme/abstract-ABergmann-1.shtml&quot;&gt;How to not invent kernel interfaces&lt;/a&gt;.
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245620/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245620/rss</link>
      <dc:date>2007-08-15T01:32:47+00:00</dc:date>
      <dc:creator>michaelk</dc:creator>
      <description>
      But in the lack of a formalized review process, this still won't fix the problem.&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245619/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245619/rss</link>
      <dc:date>2007-08-15T01:24:35+00:00</dc:date>
      <dc:creator>michaelk</dc:creator>
      <description>
      &lt;em&gt;&quot;one of the best ways to find shortcomings in an API is to attempt to document it comprehensively&quot;
&lt;p&gt;
True. However it's not nearly as good when the person involved in writing the code implementing the API also writes the documentation -- that does not strain underlying assumptions in the way that thorough review and proper documentation processes tend to.
&lt;/em&gt;
&lt;p&gt;
Agreed.  However, I've been trying to encourage kernel developers to supply the beginnings of a man page that I then review.  Even that is a very fruitful process, when it happens.  But the ideal is of course as you suggest a much better review and documentation process involving kernel developers.

&lt;p&gt;
&lt;em&gt;
So perhaps once the API is in glibc and documented by another party it could be considered &quot;stable&quot;.&lt;/em&gt;
&lt;p&gt;
There are many problems with this idea: some APIs never make it to glibc; sometimes glibc provides a wrapper that modifies the API; sometimes documentation does not arrive for a very long time...
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245616/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245616/rss</link>
      <dc:date>2007-08-15T00:49:07+00:00</dc:date>
      <dc:creator>gdt</dc:creator>
      <description>
      &lt;p&gt;IETF requires two independent implementations before approving a protocol. Something similar should be true for system calls: used by two independent applications. There's a lot of narrow thinking exposed in some system calls, and this would widen that. I've had the joy of using the TASKSTATS feature in a way not forseen by its author and until recently it wouldn't compile from user space at all since its header file was omitted.&lt;/p&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245599/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245599/rss</link>
      <dc:date>2007-08-14T20:46:56+00:00</dc:date>
      <dc:creator>asamardzic</dc:creator>
      <description>
      Great to see that lots of things once requiring messing with signals are getting exposed trough some kind of file descriptors, not only in Linux but in other Unix flavors as well.  It really feels &quot;Unix way&quot;, let's hope SUS will catch and standardize alike syscalls once...&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245578/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245578/rss</link>
      <dc:date>2007-08-14T19:33:07+00:00</dc:date>
      <dc:creator>nix</dc:creator>
      <description>
      Certainly having a system where syscalls *don't* automatically transition &lt;br&gt;
out of beta state is a recipe for disaster: the lesson of &lt;br&gt;
CONFIG_EXPERIMENTAL is that a lot of them will simply never transition at &lt;br&gt;
all :(&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245574/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245574/rss</link>
      <dc:date>2007-08-14T19:00:40+00:00</dc:date>
      <dc:creator>musicon</dc:creator>
      <description>
      Perhaps allowing interface changes to remain in &quot;beta&quot; through the first released kernel containing them, and then &quot;final&quot; in the next kernel release.&lt;br&gt;
&lt;p&gt;
Eg, timerfd is beta in .22, final in .23?&lt;br&gt;
&lt;p&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245570/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245570/rss</link>
      <dc:date>2007-08-14T18:49:24+00:00</dc:date>
      <dc:creator>bronson</dc:creator>
      <description>
      &lt;font class=&quot;QuotedText&quot;&gt;&amp;gt; it is seen as a way of avoid proper thought ahead of merging a new API into the kernel.&lt;/font&gt;&lt;br&gt;
&lt;p&gt;
The problem with this is that no amount of proper thinking will shake out everything.  Comprehensive documentation goes a long way, certainly, but some problems will only come to light once people actually start using an interface.&lt;br&gt;
&lt;p&gt;
The kernel team is really good at following convention and knocking bad patches down; I don't see any reason to believe that a beta period would turn into a crutch to avoid proper thinking.  Are there any other reasons a beta period would be bad?  It just seems like common sense to me!&lt;br&gt;
      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/245569/rss">
      <title>timerfd() and system call review</title>
      <link>http://lwn.net/Articles/245569/rss</link>
      <dc:date>2007-08-14T18:30:16+00:00</dc:date>
      <dc:creator>mhelsley</dc:creator>
      <description>
      &quot;one of the best ways to find shortcomings in an API is to attempt to document it comprehensively&quot;&lt;br&gt;
&lt;p&gt;
True. However it's not nearly as good when the person involved in writing the code implementing the API also writes the documentation -- that does not strain underlying assumptions in the way that thorough review and proper documentation processes tend to.&lt;br&gt;
&lt;p&gt;
So perhaps once the API is in glibc and documented by another party it could be considered &quot;stable&quot;.&lt;br&gt;
      
      </description>
    </item>
</rdf:RDF>

