[TUHS] Clever code (was Re: Re: Stdin Redirect in Cu History/Alternatives?

Dan Cross crossd at gmail.com
Fri Dec 16 00:02:08 AEST 2022


On Thu, Dec 15, 2022 at 12:38 AM Bakul Shah <bakul at iitbombay.org> wrote:
> Don't see how unless they put multiple related services in the same
> address space, which reduces context switching but tends toward a
> monokernel (& increased coupling). Unless I am misunderstanding you.

I don't see why two services in a microkernel couldn't arrange to
share a region of memory and implement bidirectional queues
between themselves. With an appropriate signalling mechanism,
you'd still be context switching but avoiding a lot of copying.

        - Dan C.


> > On Dec 14, 2022, at 6:54 PM, Larry McVoy <lm at mcvoy.com> wrote:
> >
> > Wasn't there some statement that QNX dropped some of these?  Copy plus
> > context switch?
> >
> > On Wed, Dec 14, 2022 at 04:29:45PM -0800, Bakul Shah wrote:
> >> On Dec 11, 2022, at 7:09 PM, Andrew Warkentin <andreww591 at gmail.com> wrote:
> >>>
> >>> It's not necessarily true that microkernels are significantly slower.
> >>
> >> uKernels are usually quite fast as they do so little. What can be slow
> >> is emulating a Unix like OS on top due to context switches. For instance,
> >> a user process doing read() will have the following context switches:
> >>
> >>  userProc->uK->FileSystem->uK->diskDriver->uk->FileSysem->uK->userProc
> >>
> >> or worse (I didn't account for a few things). Because of this even some
> >> uKernels run a few critical services + drivers in the supervisor mode.
> >> But overall slowdown of such a unix emulation will very much depend on the
> >> workload and also what kind of performance improvements you are willing to
> >> try in a complex kernel vs same services running in user mode.
> >>
> >> At present the linux kernel has about 31+ Million lines (accounting for
> >> all architectures, filesystems, device drivers etc.). The FreeBSD 13.x
> >> kernel is about 8.7M LoC (of which 44-45% are in device drivers). I only
> >> counted .c and .h files. In contract FreeBSD 2.2.2 kernel has ~554K LoC.
> >> This LoC growth is entirely understandable but I wonder how things may
> >> have turned out in an alternate universe of uKernel based designs....
> >
> > --
> > ---
> > Larry McVoy           Retired to fishing          http://www.mcvoy.com/lm/boat
>


More information about the TUHS mailing list