Re: Linux's implementation of poll() not scalable?

From: Linus Torvalds (torvalds@transmeta.com)
Date: Mon Oct 23 2000 - 20:42:39 EST


On Tue, 24 Oct 2000, Andi Kleen wrote:
>
> Also with the poll table mmap'ed via /dev/poll and the optimizations I
> described poll could be made quite nice (I know that queued SIGIO exists,
> but it has its drawbacks too and often you need to fallback to poll anyways)

The problem is that your proposed optimizations would be horrible: the
poll events themselves happen when some other process is running, so you'd
have to do some serious VM hacking and consider the poll table to be some
kind of direct-IO thing etc. Ugh.

And the file->fd mapping is not a simple mapping, it'a s 1:m mapping from
file -> potentially many [process,fd] pairs.

Doing the caching across multiple poll-calls is even worse, you'd have to
cache where in user space people had the array etc. Not pretty.

I'm sure it can be speeded up, I'm just not sure it's really worth it if
you'd instead just have a better interface that wouldn't need this crap,
and consider poll() as just a compatibility layer.

                Linus

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



This archive was generated by hypermail 2b29 : Mon Oct 23 2000 - 21:00:22 EST