DIR Return Create A Forum - Home
---------------------------------------------------------
Embedded Systems
HTML https://embeddedknowlwdge.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: Microcontroller Topics
*****************************************************
#Post#: 2--------------------------------------------------
Top Half and Bottom Half in Linux
By: ravi23ganiga Date: March 11, 2014, 12:22 pm
---------------------------------------------------------
Bottom half and Top Half in Linux
--Interrupt handlers are asynchronous routines which executes
when hardware interrupts occurs
--When ISR occurs, then one or more interrupts are disabled in
the system, at the time when
the interrupts are disabled and other interrupt occurs, then
those interrupt processing is
delayed in execution.
--So ISR should be as short as possible
-- Also interrupts execute in atomic context , so ISR cannot
sleep
-- SInce ISR are asynchronous and does not have user space
context so they cannot access
user space process memory region
-- If the task to be done in ISR is short then it can be done is
ISR
-- If the task to be done in ISR is long then it has to be done
outside of ISR to make ISR short.
--But ISR tend to do lot of things so , the task of ISR is
needed to be broken down in two
parts, those tasks which are necessary to be done in ISR (eg in
UART RX ISR the receive data should
be read in) and those tasks which can be delayed or in linux it
is called deffered.
--The tasks that are to be done in ISR are called top half of
the processing and that can be deffered
is called bottom half or deffered processing. Top halfs
schedules Bottom half
#Post#: 3--------------------------------------------------
References
By: ravi23ganiga Date: March 11, 2014, 12:30 pm
---------------------------------------------------------
HTML http://www.ibm.com/developerworks/library/l-tasklets/
HTML http://zeniv.linux.org.uk/pub/linux/people/willy/willy/lca/paper.pdf
HTML http://www.makelinux.net/ldd3/chp-10-sect-4
#Post#: 4--------------------------------------------------
Bottom Half
By: ravi23ganiga Date: March 11, 2014, 2:04 pm
---------------------------------------------------------
Bottom Half
-- Bottom half are used to defer work from interrupt context.
Context
-- Code in Linux kernel executes in following context
-- Process Context
-- Process context execute code on behalf on user
space. All system calls execute in process context.
-- Bottom Half context
--Soft Irq, Tasklets, Timers execute in this
context
-- Interrupt Context
-- Interrupts execute in interrupt or atomic
context
-- Interrupts are one of the important resources and they are
the key resource for the responsiveness of the system
If interrupts are small, system will respond fastly, so
interrupts are one of the most important resouces to be managed
*****************************************************