tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: dev/ic/com.c, callouts and cv_wait
matthew green <mrg%eterna23.net@localhost> writes:
>> I have used cv_wait from kernel threads before, but I have never
>> attempted to do use them from a callout (I don't think). Did I miss
>> something, or is this case not allowed??
>
> callouts run from softint threads, and softint threads are a
> limited resource -- only one per level per cpu, so if one of
> them blocks waiting for something, it means *all* processing
> at that level is blocked until the resource is back. we tend
> to disallow this usage because it can lead to weird locking
> and hang/starvation issues.
Thank you sir. That explains the situation.
> you may want to create a dedicated kernel thread to run the
> real processing in, using the callout to trigger that thread
> perhaps, or avoid it entirely and directly triggering the
> thread from whatever is triggering the softint now.
Ya, I have though of using a kthread as all the callout is doing is
creating a loop to check the interrupt status register at a paticular
tick interval. It should be possible to use a kthread to do the same
thing and not bother with the callout at all.
> there's also workqueue(9) that might supply much of the setup
> you need.
>
>
> .mrg.
--
Brad Spencer - brad%anduin.eldar.org@localhost
Home |
Main Index |
Thread Index |
Old Index