Last year I wrote a series of 3 patches for the 2.1.5x series kernels
which provided ways to speed up polling.
The first patch removed unnecessary wait-queue manipulation, which
gave a speedup of 2x for select(2) and poll(2) with zero
timeouts. This patch was eventually integrated into Linus' kernels.
The second patch removed the need for f_op->poll calls (an optional
flag was added to struct file which could be queried by do_select()
and do_poll()). This speeded up polling by another 3x to 4x. This
patch required no changes to userspace code.
Finally, the third patch created the poll2(2) syscall. This provided a
more efficient interface to the kernel, and removed the need for an
application to search all fds to see where there was activity. Since
the kernel already has to search all fds for activity, it is more
efficient to pass back to userspace a short list of fds which have
activity, saving the application the time of searching the big list of
fds. This new syscall works well for both single-threaded and
multi-threaded servers.
Both the second and third patches would massively improve the
scalability of polling in Linux. Unfortunately, I didn't manage to
get either into Linus' kernel, so after perfecting my patches, I
stopped working on them. If I can get some encouragement from people
who's opinion has some weight with Linus, I could resurrect these
patches.
FYI: the second patch is gathering dust at:
http://www.atnf.csiro.au/~rgooch/kernel-patches.html
I posted quite a bit of benchmarking information back in September
regarding these patches, so troll through the archives if you're
interested.
Regards,
Richard....
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu