Re: Why can't we sleep in an ISR?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> I have a very basic doubt here ... what makes it impossible to sleep
> in an ISR? I mean, I know that the kernel preemption is disabled and
> the kernel will panic, but I could not understand why?

The impossibility to sleep comes as a natural consequence of the fact
that ISRs have to be fast.

An ISR has to be fast in order to allow other system tasks to happen.
Otherwise it will do a lot of work (like busy waiting) and any other
interrupts will fail to get handled. That would completely render the
system unusable.

Agreed.


On the other hand, when you sleep in a given context, the scheduler is
invoked. That means that the ISR routine would be replaced by a process
from the scheduler's queue(s). But how would you ever know to reschedule
the ISR? After all, it is asynchronous.

Uh, this is what I have my doubt about. Yes, the scheduler may try to
replace the current process (already interrupted by the ISR) with
another process.

So, what is the problem with that? Could you please elaborate on the
part "how would you ever know to reschedule the ISR? After all, it is
asynchronous"?

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux