Somebody should send/tweet this to Bryan Lunduke, just to let him know that his recent statement about "how the linux kernel growth is bad for performance etc..." in a talk is not quite true.
How in the world does a picture of lines of code in the Linux kernel act as evidence of kernel performance.
To quote linus before he changed his stance to "Faster hardware is making it not a problem" he did say
We're getting bloated and huge. Yes, it's a problem ... Uh, I'd love to say we have a plan ... I mean, sometimes it's a bit sad that we are definitely not the streamlined, small, hyper-efficient kernel that I envisioned 15 years ago ... The kernel is huge and bloated, and our icache footprint is scary. I mean, there is no question about that. And whenever we add a new feature, it only gets worse.
To say something isn't a problem because we're getting faster than I'm making it slower is still admitting that you are worsening performance
You are right, this is not intended to communicate the performance characteristics of various kernel releases. But you might want to be careful putting too much weight into a comment that is old enough to be in the fourth grade. During this period we've seen a lot of developments, like Linux being pushed harder towards mobile and embedded workloads.
Phoronix did a set of really interesting benchmarks across kernel releases which at least for the last 4 years hasn't showed significant performance degradation in the workloads they tested. Apart from the spectre/meltdown mitigations.
Anecdotally having worked for a company with a ton of Linux servers, fleet wide kernel upgrades don't have a tendency to affect performance much when looking at global CPU or memory utilization. Optimizations in the application layer tend to have a much larger impact.
Honestly you can use Gentoo or compile your kernel even on other distro, the fact that the code is there doesn't mean it has to be executed or even compiled.
(I'm not in kernel dev) yeah, in an ideal world I would *probably* expect that a 100% correctly modularized and engineered kernel, you could just exclude things and get the same performances.
In the real world with a 15M+ lines code, there are probably millions of hidden reason which can worsen performance. The fact the Linux is ~scared is not casual
What do you mean "correctly modularized and engineered"? When drivers are compiled as modules (the default) they are not loaded if they are not needed.
They're called modules but they are not really modular, there's no internal driver API so the whole kernel is globally accessible. If it were really modular with some kind of defined API then you could theoretically use Linux drivers on another kernel that implements the API. IMO this should be the Linux end-game but I don't think it will ever happen because rea$ons.
Linux does not have stable internal interfaces, but they are interfaces nonetheless. A kernel being modular has nothing to do with your concept of some ideal API that allows modules to be loaded by other systems.
I'm also curious how having a driver API that meets your requirements would prevent a kernel mode driver from accessing other kernel code.
Interesting, I wish I knew more about android but I just can't get excited about it. Probably because of dalvik vm or whatever they use these days, and all the proprietary and arguably GPL-violating code needed to boot some of the machines.
You do know that most of the kernel code is in the form of modules, and is loaded on-demand? Only the core code needed for initialization, memory management, disk management, process scheduling, interrupts etc. has to absolutely be in memory at all times, and that portion doesn't take up much memory (although the data structures used might take up a bit more, it's nothing compared to userspace memory usage).
Don't forget all the code that's for handling various architectures (looks like about 2M lines), and which will actually be entirely compiled out for every arch other than the one you need.
He makes the point that some things used to speed up and/or get smaller with every new release, but now that there is so much corporate influence in distros and kernal dev, no one is focusing on those gains anymore.
Like: Development stalls because we have an OS that's composed of 10000 different parts that some somehow interact in a weird way using semi stable APIs, just to give us pretty shitty performance.
Like if you really want separation of concerns and security you separate the memory regions between the parts of the kernel since each part is a process right?. Now simple things like performance become nearly impossible for implementing poll in a sane way across 6 different process eg net, fs, terminals, pipes, etc...
This is 1 example of 50+
Micros kernels are great for certain situations. But supporting something like POSIX. Well not so much. Cause shit gets awkward then you have to support legacy api's that are used by "everyone"
Or another simple way to look at it. If they work so damm well? Where are they?
And still are which is why we don't use micro kernels.
So here is yet another reason. Take a basic arm chip. There is no io-mmu in its spec. There is in x86_64 (its also optional btw). IF you have different "processes" for each driver and have them protected from each other by memory. You can still have a device "tank" the system with a corrupt pointer or a bug. Your not really protecting anything. Why? Well if you write an incorrect pointer to a dma reg on the hardware it will still be able to write around the cpu memory protections. So at this stage your now have the same problem as the monolitic issues. Except you sacrifice a massive part of performance to do that.
That's possibly a good argument for a kernel for embedded devices not for personal computers.
You could use a software isolated process?
Well if you write an incorrect pointer to a dma reg on the hardware it will still be able to write around the cpu memory protections.
IF you write an incorrect pointer.
With tech like Intel VT-d you can in fact restrict direct memory access.
I think microkernels are overhyped myself but I think that's because people aim far too high for them.
There are a bunch of very old and obsolete protocols and filesystems that don't need to be very fast and are usually only used for backwards compatibility. Shoving them into user space seems best to me. I shouldn't need a kernel driver to copy a tarball from an old USB stick with some obscure and barely used filesystem.
79
u/CKreuzberger Nov 07 '18
Somebody should send/tweet this to Bryan Lunduke, just to let him know that his recent statement about "how the linux kernel growth is bad for performance etc..." in a talk is not quite true.