tech-kern archive

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

Re: bottom half



On 2015-06-19 11:45, Edgar Fuß wrote:
"Runs on kernel stack in kernel space" is not the same thing as the Linux
concept of bottom half. :-)
I don't know what the Linux (or VMS or Windows) concept of "nottom half" is.
I thought I knew what the BSD concept of kernel halves is.

I can't comment on Windows - I have no idea.
VMS uses a very different solution, so it don't make much sense to talk about that here (or at least the parts that I know, which might be outdated).

If I remember Linux right, they have a fixed list of registered bottom half handlers (which of course ran out of space a long time ago), and then through some tricks extended it to be more general, but in essence the bottom half is the part of the device driver that runs after an interrupt to complete an I/O request. The top half being also running in the kernel, but in the context of a process that does the I/O, and the top half blocks until the I/O completes. And the bottom half is the part the unblocks the top half again. And each driver has its own bottom and top halves. One major point of the bottom halves is that when running the bottom half, interrupts are not blocked. A device driver normally do only a minimal amount of work in the interrupt handler itself, and then defer the rest of the work to the bottom half code, which will run at some later time.

Of course, I could be remembering this all wrong, and it might be outdated as well. So take what I write with a grain of salt. Or rather, read up on it in a Linux book instead.

I would say the bottom half concept in Linux is close to the softint stuff in NetBSD. But I might be wrong on that one, as I don't remember all the details of that either right now.

And tghe text you refer to in the 4.4BSD book then obviously are not describing the same concept as the Linux bottom halves, as the Linux bottom halves do not handle the hardware interrupt itself, and they can be interrupted by anything.

	Johnny

--
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt%softjar.se@localhost             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


Home | Main Index | Thread Index | Old Index