About schedule() and ISRs

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

 



Hello,

I am reading Robert Love's book on kernel development, and it states
that interrupt handlers (that execute on interrupt context) cannot
call functions that sleep, because then the ISR's execution thread
would be halted and never again rescheduled. Ok, makes sense.

However, I couldn't help noticing that, in page 75 of Robert's book,
it is stated that, when called upon from ret_from_intr()
(arch/i386/kernel/entry.S), schedule() actually RETURNS, and then
ret_from_intr() can resume executing.

How can schedule() return if it immediately transfers the CPU control
to another process? Can it happen when the interrupted process is
rescheduled (since it shares its stack with the ISR)? If that is
indeed the case, then I failed to see why one must not call sleeping
functions from ISRs, since they would resume executing just fine next
time the interrupted process was scheduled for execution...

I'd apprecciate any feedback on this.

Thanks a lot,

-- Martim

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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