select-readme

This patch removes the wait queue manipulation when you call select(2)
with a timeout of 0 (i.e. don't wait). It does the same thing for
2.0.31 as my select patch for 2.1.52.

The theory behind this is that if you don't want to wait, there is no
need to place the process on a wait queue (a process placed on a wait
queue will be put to sleep on a subsequent call to schedule(), not
before, as kernel code is not pre-emtable).

This patch also prevents the allocation of a wait table entry if there
is no need to manipulate wait queues (i.e. zero timeout).

These unnecessary manipulations of wait queues consume a lot of time:
without this patch it takes 4 milliseconds to call select(2) and
now it takes 0.8 milliseconds. The timing test was performed on a
Pentium 100 while polling 253 file descriptors. The file descriptors
are from the pseudo tty device created for a rlogin session.

In addition, not allocating a page to hold the wait table can save a
lot of time in RAM starvation situations, where the polling process
may have to wait for some page to be swapped to disc before one is
freed.

The patch is against 2.0.30 + pre-patch-9. Note that 2.0.30 +
pre-patch-9 is destined to become 2.0.31.

Note that if you really want high performance, you should really use
2.1.54 or later.