Re: Looking at select, a problem or functionality?

From: Manfred Spraul (manfred@colorfullife.com)
Date: Mon Jul 17 2000 - 13:51:29 EST


Damn. I should reread my mail before sending them.

Manfred Spraul wrote:
> > do_pollfd() calls the driver poll routine. Is it
> > expected that the driver might in some way call schedule() and put the
> > current task to sleep?
>
> Yes.
This one is wrong.

do_pollfd calls f_ops->poll() [yes to the first part], but the driver
should not call schedule() [no to the second part], it should avoid it
whereever possible. It might happen that it sleeps, but the
TASK_INTERRUPTIBLE has nothing to do with that sleeping.

TASK_INTERRUPTIBLE is required for the Linux wait queue implementation,
as explained in Alan's mouse driver article.

If the driver must sleep, then someone must reset current->state to
TASK_RUNNING before sleeping: a driver calls
poll_wait()->__pollwait()->kmalloc()->...->try_to_free_pages()

and try_to_free_pages will resets current->state.

Sorry for the confusion,
        Manfred

-
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 : Sun Jul 23 2000 - 21:00:09 EST