Linked by Thom Holwerda on Tue 9th May 2006 21:25 UTC, submitted by luzr
OSNews, Generic OSes Torvalds has indeed chimed in on the micro vs. monolithic kernel debate. Going all 1992, he says: "The whole 'microkernels are simpler' argument is just bull, and it is clearly shown to be bull by the fact that whenever you compare the speed of development of a microkernel and a traditional kernel, the traditional kernel wins. The whole argument that microkernels are somehow 'more secure' or 'more stable' is also total crap. The fact that each individual piece is simple and secure does not make the aggregate either simple or secure. And the argument that you can 'just reload' a failed service and not take the whole system down is equally flawed." My take: While I am not qualified to reply to Linus, there is one thing I want to say: just because it is difficult to program, does not make it the worse design.
Thread beginning with comment 122796
To read all comments associated with this story, please click here.
Abstraction
by saterdaies on Tue 9th May 2006 21:48 UTC
saterdaies
Member since:
2005-07-07

To be honest, it sounds like an argument of abstraction. Monolithic kernels have everything programmed together in one jumbled mess. Microkernels section things off and use ways of communicating the relavant things between different parts. For me, this whole argument has always come down to abstraction. Abstraction does use additional resources, but I, personally, believe it yields better results in the long run. Linus is an exceedingly gifted programmer, but I have to disagree with his view here.

Reply Score: 4

RE: Abstraction
by luzr on Tue 9th May 2006 21:58 in reply to "Abstraction"
luzr Member since:
2005-11-20

Abstraction does use additional resources, but I, personally, believe it yields better results in the long run.

Nope. Read it more carefuly. This has nothing to do with abstraction. The problem is that mikrokernel forces you to program almost EVERYTHING as distributed algorithm - that is way harder and way more complex.

You may have noticed complaints about how hard it to write multithreaded programs that use those fancy dualcore CPUs. Now complex distributed code is order of magnitude harder to write and maintain than that.

And at the end of process, you will end with slow and unreliable monster.

Edited 2006-05-09 21:59

Reply Parent Score: 4

RE[2]: Abstraction
by BryanFeeney on Tue 9th May 2006 22:41 in reply to "RE: Abstraction"
BryanFeeney Member since:
2005-07-06

Nope. Read it more carefuly. This has nothing to do with abstraction. The problem is that mikrokernel forces you to program almost EVERYTHING as distributed algorithm - that is way harder and way more complex.

Huh? Microkernels are basically extremely small kernels that facilitate message passing and basic hardware abstraction, and delegate everything else to user-space.

Think about the relationship between Linux and X.org (or Linux and SANE), and then imaging more X.orgs for sound, networking, etc. Then extend it a bit more so there's an X.org for the VM another for the scheduler.

Imagine they all communicate using a specific messaging system. That's a microkernel. It has got absolutely nothing to do with multi-threading.

Inded, every kernel, regardless of how it's designed, has to deal with loads of non-trivial concurrency issues (in particular race-conditions).

Edited 2006-05-09 22:43

Reply Parent Score: 5

v RE[2]: Abstraction
by tummy on Wed 10th May 2006 06:37 in reply to "RE: Abstraction"
RE: Abstraction
by renox on Tue 9th May 2006 22:08 in reply to "Abstraction"
renox Member since:
2005-07-06

>it yields better results in the long run.

Perhaps, but when?
Not yet: MacOS X show that a micro-kernel can give poor performance (normal it has Mach underneath) if usable, can it provide fault tolerance to faulty drivers? Is-it more stable than say Solaris?
Mmm, I don't think so. So while advantage of micro-kernels are not so easy to get, the inconvenients are real.
Having to do lots of research to get 'not too ugly' performances is good for academics but for the other..

Some other micro-kernels have better performances than Mach (if still slower than monolithic kernels), but apparently their theoretical supeority isn't a good enough argument for FOSS developpers to dump existing monolithic kernels to work on them..

Sure there are some commercial niche player with very good muk, but as evidenced by their niche status, having a muk is not in itself a killer feature in general.

Reply Parent Score: 5

RE: Abstraction
by BryanFeeney on Tue 9th May 2006 22:37 in reply to "Abstraction"
BryanFeeney Member since:
2005-07-06

Monolithic kernels have everything programmed together in one jumbled mess.

No, they don't. Monolithic kernels are just as modular as microkernels. The difference is that monolithic kernels integrate drivers into their address space, whereas micro-kernels don't. This keeps micro-kernels safe from coding errors (e.g. buffer overflows), but not semantic errors

Micro-kernels still have issues: what do you do if the scheduler server dies? Sure you can restart it, but you'll have lost track of the state of every running process. What happens if a file-system driver dies: when you restart it, can you be sure all existing system calls will be completed; if they're not, will that affect stability?

Furthermore, it is possible to sandbox device drivers in a monolithic kernel, using certain API constructs, giving them most of the benefits of microkernels: one example of this is the Nooks project.

To be honest, it sounds like an argument of abstraction.

It's not, it's about enforcing policy. Both monolithic kernels and micro-kernels have similar designs: both are usually quite abstracted and modular as it's the only way to manage a large and complicated piece of software like an OS kernel. The difference is that a microkernel puts in place special code to enforce that policy.

However this code almost always has severe performance penalties; only one major operating system thus far - QNX - has managed to pull it off without sacrificing efficiency Given that monolithic kernels can be just as modular as microkernels, and can insulate drivers as well as microkernels, the enormous amount of extra work required to implement an interface between kernel and userland simply isn't warranted.

The only exception to this is possible security orientated operating systems. Here, the separation of policy is important enough to sacrifice performance / put in the extra work.

Edited 2006-05-09 22:45

Reply Parent Score: 5

RE[2]: Abstraction
by twenex on Tue 9th May 2006 22:46 in reply to "RE: Abstraction"
twenex Member since:
2006-04-21

only one major operating system thus far - QNX - has managed to pull it off without sacrificing efficiency

I daresay the Amiga microkernel-based OS was pretty efficient

Reply Parent Score: 5

modularity
by viton on Wed 10th May 2006 16:47 in reply to "RE: Abstraction"
viton Member since:
2005-08-09

Monolithic kernels are just as modular as microkernels.
Ok, Can i use dynamically loadable 2.14 driver on 2.16 kernel?

http://www.linux-ntfs.org/content/view/187/
2.6.16-1.2111_FC5
2.6.16-1.2107_FC5
2.6.16-1.2096_FC5
2.6.16-1.2080_FC5
2.6.15-1.2054_FC5
These guys have a compiled driver for every kernel revision.
This is an absolute nonsense.
Doesn't it make sense to have only latest version if you said what linux is modular?

AmigaOs inspired OS-es are truly modular and have a lighting fast message passing. Of course it lacks memory protection, but there are 3 ways: 64bit protection domains or the "Singularity" approarch with safe languages or both at the same time.

Reply Parent Score: 1

RE: Abstraction
by theGrump on Tue 9th May 2006 22:51 in reply to "Abstraction"
theGrump Member since:
2005-11-11

"Monolithic kernels have everything programmed together in one jumbled mess."

why is it "jumbled"?

why is it a "mess"?

have you ever read the kernel source code?

Reply Parent Score: 1

RE: Abstraction
by d a v i d on Wed 10th May 2006 00:39 in reply to "Abstraction"
d a v i d Member since:
2005-07-06

I don't know if Linus means to say that monolithic designs are better than modular / component based designs (not just for the OS, but all applications), but I certainly can't agree with the idea that monolithic designs in general are better at all.

If that's what he does mean, than one can only assume he isn't particularly fond of OO-design, which is pretty much universally regarded as a Good Thing.

Reply Parent Score: 0

RE[2]: Abstraction
by hobgoblin on Wed 10th May 2006 08:07 in reply to "RE: Abstraction"
hobgoblin Member since:
2005-07-06

there is a reason why much of the core code of the linux kernel is written in C rather then C++ ;)

and i think the stance on OO is that while its a good thing as you get stuff like code reuse and similar, it adds a whole lot of complexitys on top. and those complexitys have a bad habbit of adding up as the project grows.

Edited 2006-05-10 08:10

Reply Parent Score: 1

RE: Abstraction
by shulud on Thu 11th May 2006 09:06 in reply to "Abstraction"
shulud Member since:
2006-05-11

> To be honest, it sounds like an argument of abstraction.
> Monolithic kernels have everything programmed together
> in one jumbled mess. Microkernels section things off
> and use ways of communicating the relavant things
> between different parts.

That is a misconception then. Monolithic kernels do use simple well defined abstractions and they are split into functionally separate components. The difference is, monolithic kernel uses direct function calls instead of messaging.

Reply Parent Score: 1