[okl4-developer] pagefault
Gernot Heiser
gernot at ok-labs.com
Fri Aug 1 10:01:03 EST 2008
>>>>> On Thu, 31 Jul 2008 18:32:06 +0200, "Frank Kaiser" <frank.kaiser at opensynergy.com> said:
FK> Hello, Matthew
FK> Many thanks for pointing me to the document. The main statement I derive
FK> from it is that the L4 kernel is a single stack thread. Any process
FK> entering the kernel domain (mainly by software or hardware interrupt) is
FK> assigned the same stack of 1 kB. I could reproduce this in the
FK> ARM-specific code of the exception handlers.
FK> I can also follow the statement that a single stack kernel has a
FK> reentrancy problem which can easily be avoided by disabling hardware
FK> interrupts in the kernel domain, with a negative impact on interrupt
FK> latency. I have not yet determined what the current code of v2.1 is
FK> doing to this respect.
I'll let our engineers answer the specific questions, but here's a
quick general comment on what you've been saying.
It is, a priori, incorrect to say that the single-kernel stack
approach leads to higher interrupt latency. When looking at interrupt
latencies one is trading off the cost of a preemption/concurrency
control against the period during which interrupts are disabled. Every
kernel disables interrupts for some time, the question is how long.
In traditional systems, the correct way to minimise interrupt
latencies is to turn interrupts on as soon as possible. This means
your kernel is preemptable, and you need concurrency control
throughout the kernel. This itself has an impact on latencies (and
even more on average-case performance).
OKL4 is designed to have very fast system calls. Typically the time
the kernel is executing for is of the same order as it takes to take
an interrupt. In such a scenario, a preemptable kernel makes no
sense, it is far better to run the present syscall to completion, and
take the interrupt when returning to user mode.
The net effect on interrupt latencies is minimal, the impact on
overall performance is significant.
Note that some longer-running operations are unavoidable for a
general-purpose kernel. These are dealt with by introducing explicit
preemption points.
Gernot
More information about the Developer
mailing list