Re: Of locks, spinlocks and printks in schedule()

Steve Dodd (dirk@loth.demon.co.uk)
Tue, 27 Jul 1999 19:23:14 +0100


On Tue, Jul 27, 1999 at 12:31:01PM -0400, Hugo Varotto wrote:

> Now, I don't know why, but it seems that if I putt a
> printk in the schedule() routine, between the pair of
>
> spin_lock_irq(&runqueue_lock);
> ...
> spin_unlock_irq(&runqueue_lock);
>
> commands, the kernel crashes ( or actually, to be more precise, it
> freezes ).

Err, printk() does a

wake_up_interruptible(&log_wait);

__wake_up() calls wake_up_process() for each process on the wait queue, and
this gets the runqueue_lock again.

-- 
We are Linux. Resistance is an indication that you missed the point.

- 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/