Re: poll() in 2.6 and beyond

From: Bill Davidsen
Date: Tue Mar 02 2004 - 17:55:38 EST


Roland Dreier wrote:

I don't know why I continue this, but.... can you point out the line
in the kernel 2.4 source for __pollwait() where it sleeps?

Or think about it. Suppose a user called poll() with two fds, each of
which belonged to a different driver. Suppose each driver slept in
its poll method. If the first driver never became ready (and stayed
asleep), how would poll() return to user space if the second driver
became ready?

What actually happens is that each driver registers with the kernel
the wait queues that it will wake up when it becomes ready. But the
core kernel is responsible for sleeping, outside of the driver code.

Could you maybe go back to the initial report, which is that after poll() gets wrong status? It's nice to argue about where the process waits, but the issue is if it gets the same status with 2.4 and 2.6, and if not which one should be fixed.

Richard: can you show this with a small demo program? I assume you didn't find this just by reading code ;-)
-
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/