Re: A question

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

 



Interrupt context is a loaded term. It is used for both top-half and bottom-half processing.
Linux defines two terms in the top-half, one is Interrupt handler (IH) and Interrupt Service Routine (ISR).
Interrupt handler is a standard kernel code that is executed by the processor once the interrupt is generated. To abstract it, this generic code is executed for all the generated interrupts. This, in general saves the present processor context and paves way for the execution of ISR.
ISR is a interrupt service routine written by a device driver programmer to handle the interrupt of a device. ISR is mainly responsible to verify the status register of a device to find out the cause of the interrupt and act accordingly.

Both IH and ISR will not have a context of its own. Interrupts generated by a hardware device is asynchronous. i.e. it can be generated at any point in time.
When such a interrupt is generated, the current execution is interrupted and the execution  control is transferred to IH and ISR will be executed. Thus we can infer that both IH and ISR will be executing in an anonymous context.

For Eg. Consider there are 3 tasks T2, T3. Suppose T2 invoked a read system call to read data from the secondary media (say hard disk), driver of the hard disk will initiate the device to gather the data and put task T2 in the wait queue and invokes scheduler. Now, scheduler picks up say T3. When processor is executing task T3, there was interrupt generated by the harddisk controller indicating that data is ready. At this point IH and ISR is executed. IH and ISR of this interrupt has no relevance to task T3, but still it is executed in the context of T3. Hence we say that IH and ISR will always be executed in the anonymous context.

Most of the bottom half execution happens the same way, i.e. it will be executing in the anonymous context unless the job of bottom half is relegated to respective kernel threads. In the latter case the bottom half execution will have its own context.

For more details about top-half and bottom half, refer ULK 3rd edtion by Bovet, Chapter 4

Regards,
Prabhu



On Wed, Sep 1, 2010 at 9:08 PM, Hiren Panchasara <hiren.panchasara@xxxxxxxxx> wrote:
Process context is schedulable but interrupt context is not. Why and how?
Any examples I can look at?

Thanks.



--
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