Skip to contentSkip to conversation

calling sleeping functions with interrupts disabled

DISCUSSION Tachio Terauchi 1 participant 1 message Nov 19, 2001

lore
Share & tools
lore
#0 lore raw

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