Re: Wake_up_process() in interrupt handler

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

 



On Thu, Oct 31, 2002 at 01:01:27PM -0800, kernel_learner wrote:
>   I am don' completely understand the concept of
> bottom_half...can you give me some pointers abuot
> that..

I never needed it, so I don't know that much. And I don't recall where
I read about them. I think there is something about them in the Linux Kernel
Module Programming Guide and/or the Kernel Hacking Guide (both are a bit
obsolete, but the basic idea of four contexts did not change.

There are four contexts - interrupt, bottom_half, process and userland
(the correct names are probably little different). Interrupt handlers
are run with interrupts disabled. They should be fast not to mask other
interrupts for too long. If more work has to be done, the interrupt
requires a bottom-half or tasklet (limited number of bottomhalves exist,
one is used to call tasklets, which are function pointers in a list).
Bottom-halves are called "as soon as possible and is safe", which in
practice is in context-switch AFAIK (ie. return to user-land or timer
interrupt (it calls schedule)). You can only sleep (ie. call schedule())
in process context which is syscalls and kernel threads and which is
associated with a process (has valid current), since scheduler works in
terms of processes.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
--
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