But you missed the obvious optimization of doing an f_ops->poll when
the file is _added_. This means that you'll get an initial event when
there is data ready. This means you still never do a scan (only check
when an fd is added), but you don't have to do an empty read every time
you add an fd.
Before you argue that this does not save a system call, it will in
the typical case of:
<add fd>
<fail read>
<wait on events>
<successful read>
Note that it has the additional advantage of making the dispatch code
in the user application easier. You no longer have to do special code
to handle the speculative read after adding the fd.
-gordo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/