calling sleeping functions with interrupts disabled

From: Tachio Terauchi (tachio@cs.berkeley.edu)
Date: Mon Nov 19 2001 - 17:27:18 EST


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/



This archive was generated by hypermail 2b29 : Fri Nov 23 2001 - 21:00:21 EST