Re: [PATCH] Polling > 16000 FDs

From: Matthias Urlichs (smurf@noris.net)
Date: Sun Jan 09 2000 - 18:58:47 EST


Hi,

> > err = -EINVAL;
> > if (nfds > current->files->max_fds)
> > goto out;
>
[ numerous problems with this approach ]

So replace it with the current user's maximum, multiply by two (for those
who want to use different slots for read and write), and add a small
fudge factor. If you really need it.

Personally, though, I think that it's not very sensible to always use
poll(a_whole_lot) even if you've got only two files open, and it's even
less sensible to use different slots for read and write. Using the current
maximum instead isn't exactly rocket science to code, and sharing the
read and the write side in one slot isn't either.

Personally, I wouldn't let programs written with that kind of "let's eat
kernel performance on each poll() instead of adding five cheap lines of
code when the pollfd[] is set up" mindset near my system anyway if I can
at all help it. :-/

-- 
Matthias Urlichs  |  noris network GmbH   |   smurf@noris.de  |  ICQ: 20193661
The quote was selected randomly. Really.    |      http://www.noris.de/~smurf/
-- 
A time would come when Men should be able to stretch out their Eyes ...
they should see the Planets like our Earth.
                                -- Christopher Wren

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:15 EST