I think microkernel significance (4) - micro-kernel efficiency analysis

 I discussed the case did not do the actual testing of the efficiency of the micro-kernel problem appears to be wrong, I raised the issue of efficiency is also based on the mechanism, because I can put forward the optimization of space on two issues. These two questions are based on the current architecture of the best zircon microkernel (I think), or formal verification nice sel4 microkernel.

1. The Inter-process communication efficiency microkernel

SMS mechanism makes use of microkernel register to achieve a rapid transfer of data between processes short, this is a very good mechanism, a very good solution delivering a short message.

But obviously for a microkernel, one dependent on the data transfer process between the micro-kernel, the only quick short message is clearly not enough, how data after more than a short message length to do? Perhaps you can use directly between rapid and large-scale process to achieve due to memory-mapped communication, resource sharing lock problem how to do, it is clear that the complexity of the design with lock applications much more general application. Perhaps you can not lock properly designed and implemented, it is clear that the use of the kernel of the overwhelming majority of the people do not generally have such an outstanding ability to design, while the face of a variety of business logic, one side is demanding the kernel, developers simply want to I doubt it life.

So, microkernel has been among fast process communication mechanism, but the face is very common among the over limit short message communication needs of the process, it is not enough. I saw the application when data is written to the block device does not need to copy the data to a file system, process re-written, but data to be written directly to the memory map where in the past, claimed to have achieved a zero-copy in the zircon. For micro-kernel depends on the inter-process communication, demanding zero-copy data read and write speeds can be increased significantly, but the zircon-based capability, data to be written VMO the need to form a complete data segment and then write VMO, this should be a copy rather than a zero copy. I have thought really zero copy and protect the safety of the IPC, not unexpectedly, then can go to (3. problem solving) found. Perhaps this may seem extreme, but at the cost driven user mode to bring, how extreme, how frenzied the design is worth a try. After all, the microkernel is comparable to Linux in order to count and make a difference, if the same kernel, the basic performance requirements can not match it, how to use those secondary indicators?

2. The response time microkernel

In the microkernel architecture, originally in the macro kernel driver is alive in user mode process; maybe no problem at first glance, is some overhead; overhead but how to generate, how much will produce? I said <aarch64 abnormal> in, "wrote the kernel of the great God who made welfare for all programs ape: this code, we write to you (heroic tone)!." Write kernel Great God really is to send the welfare of the world?

To read and write files, for example, when the Linux open a file, when to read its contents (earnings pre-cached files here will not bring the added consideration), read from the beginning of the process quickly through the system from the user mode processes calls into the kernel mode, and then to the worker either directly Quban Quban data, there are worker and other work may need to move to be scheduled, as well as other tasks worker may have done, if it is, then let's move directly to do DMA, then thread might pause cut out, the whole process is very straightforward, worker thread is a kernel thread scheduling it into and out of context switching executed only need to save the stack, after all, the kernel page table is public. In the micro-kernel, or to me the most promising zircon, for example, through a process of communications, issued a document read request to the file system processes; as a result of a process file system, the process is certainly not escape from the virtual address space, there is address space must have a set of page tables, a set of page table accounted page table cache, the process is cut into cut spending must be greater. The Linux kernel thread due to the advantages of a total address space, worker cost is clearly smaller.

When the external device generates an interrupt, the kernel is done by interrupt handling in Linux, the same advantage because the total address space, only a small amount of thread switching time and wait for the scheduled time; and the micro-kernel interrupt handling overhead is larger the switching process (handover including handover and thread address space), waiting to be scheduled user mode / kernel mode converter etc need overhead, required time.

Implemented in user mode process drive brings stability, this stability is based on the isolation of virtual memory to achieve, but the isolation of virtual memory will also have a performance overhead, want Daiqi Guan shall inherit their weight. Only a little loss of performance, it is ignored for modern CPU is also possible, but the generation efficiency of Linux micro-kernel (ie, performance) advantage, not to overwhelm a Linux micro-kernel how to deal with the entire Linux ecosystem strife.


L4 microkernel proposed based rights management capability of the whole kernel is based on permissions set up, is said to achieve a safe; I had the authority to say is to listen carefully to maintain the attitude, but I do not think the authority of both the facts; limitations on memory the visit is the basis for the formation of rights, a modern computer system to limit MMU achieve memory access through if a section of memory, if restrict access, then it can not stop the restless hands, not based on the MMU and the smallest unit MMU page is 4KB; based capability for permission to limit, in seL4 the kernel object untyped Memory minimum 16bytes, that is not based on limited capability MMU design, so I guess seL4 micro-kernel will not let the real pointer to the user mode enter untyped Memory, but by system call will copy the contents of which untyped Memory. In zircon, the read and write system calls in which the content of the present WMO i.e., the VMO was added a further process, is the need to align the pages (the only way in which the pointer is allowed to ride dare). L4 microkernel-based design capability, I can understand their design intent, but obviously I was ignorant, and can not see whether the capability-based energy efficiency, taking into account security; after all, this lack of efficiency on the micro-kernel, with Linux when the melee, then add more efficiency shackles was also able to match it. From the point of view zircon, capability is combined with MMU, there is no loss of efficiency, but the sel4, I did not find clues.

Above La La weave said I saw the current stage microkernel also areas for improvement, in fact, not trying to express their design problems, but that, I think there are some better mechanism to achieve these two problems can improve

Published 24 original articles · won praise 3 · Views 2334

Guess you like

Origin blog.csdn.net/ytfy339784578/article/details/103946569