calling sleeping functions with interrupts disabled

Tachio Terauchi (tachio@cs.berkeley.edu)
Mon, 19 Nov 2001 14:27:18 -0800


We're trying to run a program analysis tool on the kernel source to
check for sleeping functions being called while interrupts are
disabled. This will be similar to what people at Stanford did, but
we'll be using a different technique.

Here's my question:

I noticed that sleep_on() disables interrupts before it calls
schedule(). This puzzles me because my understanding was that
schedule() must not be called with interrupts disabled (if there are
no more threads to run then the system would deadlock). Does
schedule() re-enable interrupts (it looks like it does)? If so, why
is it bad to call sleeping functions with interrupts disabled?

Sorry if this is a silly question...

-Tachio
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/