Re: locking problems

From: Jun Sun (jsun@mvista.com)
Date: Tue Mar 28 2000 - 20:13:38 EST


Rik van Riel wrote:
>
> Hi,
>
> the attached patch contains the code for a very low overhead
> fair share scheduler. Unfortunately it hangs on taking locks
> in the recalculation code :(
>
> I'm somewhat amazed by why it hangs and interested in any
> explanations...
>
> cheers,
>
> Rik
> --
> The Internet is not a network of computers. It is a network
> of people. That is its real strength.
>
> + write_lock(&tasklist_lock);
> + printk(" . . .\n");

Rik,

The problem might be the write_lock(&tasklist_lock). Interrupt handlers
sometimes call kernel functions that would require a lock on
tasklist_lock. If that interrupt happens during the time you hold write
lock on tasklist_lock, a deadlock would happen.

Try using write_lock_irq() to fix that problem.

BTW, I really think interrupt handlers acquiring the same locks which
can be acquired by processes is a *BIG* problem in Linux. We should fix
this problem. Unfortunately I am not familiar with Linux kernel well
enough to offer a solution.

Jun

-
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 : Fri Mar 31 2000 - 21:00:23 EST