Re: calling kthread_create() from interrupt thread

Jeff Garzik
2004-06-15T22:14:47Z

Jesse Barnes wrote:
> On Tuesday, June 15, 2004 2:05 pm, Dean Nelson wrote:
>
>>As mentioned above, it is possible for this "simple" function to
>>sleep/block for an indefinite period of time. I was under the impression
>>that one couldn't block a work queue thread for an indefinite period of
>>time. Am I mistaken?
>
>
> For tasklets and softirqs you're not allowed to sleep, but I think it's ok for
> work queues.

Dean is correct and incorrect ;-)

If you are using schedule_work() or schedule_task(), blocking for
extended periods of time would be very undesirable. We see this on
occasion in 2.6 uniprocessor, where a long-running keventd task may
block a console or tty update.

In 2.6, the solution is easy... create your own private workqueue. No
such solution in 2.4 (though I would argue that workqueues would help
drivers, if accepted into 2.4 at this late stage).

Jeff