Re: poll() in 2.6 and beyond

From: Richard B. Johnson
Date: Tue Mar 02 2004 - 16:27:24 EST


On Tue, 2 Mar 2004, Roland Dreier wrote:

> Richard> I'm talking about the driver! When a open fd called
> Richard> poll() or select(), in user-mode code, the driver's
> Richard> poll() was called, and the driver's poll() would call
> Richard> poll_wait(). Poll_wait() used to NOT return until the
> Richard> driver executed wake_up_interruptible() on that
> Richard> wait-queue. When poll_wait() returned, the driver would
> Richard> return to the caller with the new poll- status.
>
> I don't think so. Even in kernel 2.4, poll_wait() just calls
> __pollwait(). I don't see anything in __pollwait() that sleeps.
> Think about it. How would the kernel handle userspace calling poll()
> with more than one file descriptor if each individual driver slept?
>

Well what to you think they do? Spin?

> I'll repeat my earlier suggestion. Read the description of "poll and
> select" in LDD:
> <http://www.xml.com/ldd/chapter/book/ch05.html#t3>
>
> If you refuse to understand the documented interface, I don't think
> anyone can help you.

I am quite familiar with the operation of poll(), thank you.


Cheers,
Dick Johnson
Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.


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