Re: [LINUX-NEWBIE] When does bottom half get to run?

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

 



An excellent book addressing this is "Linux Kernel Development" 2nd Ed.
by Robert Love.

BottomHalf, "per se", (BH structured handlers) went away in 2.5. Replacing the previous mechanisms were 3 new types:
softirq, tasklets and work queues.

Softirq's and tasklets get a chance to run after each hardware
interrupt.  That means they will generally have higher priority
than user processes.  They can't "sleep", and need to be quick
about what they do (no long routines -- long routines need to be
scheduled later).

"work queues" are run in "process context" -- generically in a kernel
thread named 'events'.  There is usually one for each cpu.  If your
driver needs alot of processing, it might use it's own "private" work
queue thread.  But these threads are scheduled in the same way as are
user-processes.  The standard kernel thread(s) to process work-queues
run at "nice -5".  If you create your own thread, you can set the
priority as you wish.

So if you do "bottom half" work in a "work queue", it may or may not
be scheduled before other user-process work depending on its scheduling
priorities.

At least this is what I "gather" from my readings in the above
mentioned book. :-)
Linda

Antino Kim wrote:
Hello all,

I was reading into top/bottom half handlers of interrupt processing,
and I couldn't find an answer to my question;

when does bottom half get to run?
Actually, more specific question would be, can a task (any process...)
be running when bottom half is not empty ( i.e., there are works to be
done on be half some interrupts that happened)?
Or, does bottom half handler have priority over all tasks (meaning
that all bottom half work has to be completed before a scheduler gets
to run one of the ready processes)?

Your feedback would be appreciated. Thank you.

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

[Index of Archives]     [Audio]     [Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux