by dmitrygr · 5y ago · 0 comments
In every category imaginable, the NT kernel is better designed. Async IO, better power management, pageable kernel memory, stable driver API. I'd much rather KDE shell on NT kernel.
I get that Linux is popular, but no objective evaluation would claim that Linux kernel is better in any metric other than "how open source is it?" Spend some time to read the NT docs and get familiar with the design and you'll see.
This may be a hard pill to swallow, but in many areas linux's design is still very much "my first kernel" (I will give credit where it is due though, it is slowly being patched piece by piece, slowly). Whereas NT was written by a team who's done it a few times and avoided a lot of pitfalls (eg: synchronous by default IO, really??)
I can't comment on most of these things since I don't know much coding about them, but I will definitely grant you the stable driver API. Drivers are a huge pain in the ass in Linux, and until DKMS it was pretty common for upgrading my kernel to break my wifi card, which was really annoying.
> I get that Linux is popular, but no objective evaluation would claim that Linux kernel is better in any metric other than "how open source is it?"
I mean, that's a pretty big feature. Didn't Linux get multicore support well before Windows almost entirely because Linux was open source and popular on servers? When something is open source, companies (or people) don't have to wait for a specific monolithic company to decide that a certain feature is worthy.
> synchronous by default IO, really??
I will totally admit a lot of ignorance as I don't work in kernel spaces, but hasn't Linux had Async IO in the form of `epoll` for like 20 years? It's not the default but I feel like it's pretty commonly used.
-----
Of the things I do like about Linux (outside of open source), it follows the "everything's a file" mantra from Unix. It makes it fairly fun and easy to arbitrarily glue applications together (admittedly at the cost of performance sometimes).
Also, I like that you can choose different filesystems more or less arbitrarily. I don't have a Linux laptop anymore (I run macOS), but I when I did I was running ZFS on root with Ubuntu, and ZFS is pretty awesome. As far as I'm aware, with Windows you're basically stuck with NTFS.
As an API, epoll is kind of... suboptimal. Of course, lots of great things have been built with it, but there's a reason it's being replaced with io-uring, which is a lot more similar to Windows iocp.
https://windows-internals.com/i-o-rings-when-one-i-o-operati...
The novel thing of io-uring is using a new data structure to do it with fewer syscalls, thus less syscall overhead.
epoll() was introduced in Linux 2.5.44 [1], which was released in 2002 [2]. Epoll is not a wonderful API. Linux's real reply to NT's anync io is io_uring, which only appeared in Linux 5.1 [4] in 2019(!!) [2], and is still wildly evolving
[1] https://en.wikipedia.org/wiki/Epoll
[2] https://en.wikipedia.org/wiki/Linux_kernel_version_history
Granted, that’s not really a good excuse for Linux having a crappy system, just why I think there wasn’t ever a ton of urgency for it.
https://windows-internals.com/i-o-rings-when-one-i-o-operati...
In begin of AMD64 a lot of Windows software was single threaded 32 bit still, while on Debian with APT you had a working 64 bit environment. It was mostly userland which could not handle the amount of max cores found in even consumer grade multicore AMD64.
Even recently many games did not take advantage of multiple cores, while AMD has been strong performance wise multiple cores, Intel was best single core until Zen 3 recently. Windows would be unable to perform well (use max cores) on AMD64 by AMD.
You can see it now too. Intel gets slight performance boost with Windows 11 compared to 10 while AMD loses performance. Which AMD said they will address in October.
Edit:
Microsoft wouldn't ever open-source NT but, damn, GNU/Windows NT would be a sweet OS to use. (Make it license-compatible with ZFS and it'd be awesome.)
I wouldn't say never. I think the chance of that happening is ever so slightly increasing every year. The benefits of open source NT kernel will some day outweigh Microsoft keeping it close. Its strategic value is decreasing. ( The whole OS on the other hand is a different question though. )
Interix was implemented in more of a pure "NT" manner, being a subsystem, as compared w/ WSL1. WSL1 just shims Linux syscalls. I'd rather build software from source targeting Interix (as just another "Unix"-flavored build target) than running native Linux binaries.
https://docs.microsoft.com/en-us/windows-server/administrati...
It took them 7 years to get it stable enough to run on Windows Server, and they had to rewrite the entire stack to do it.
Until then, they were running the service on Unix.
https://news.softpedia.com/news/Windows-Live-Hotmail-Was-Pow...
There are absolutely parts of Linux with all the architecture and engineering rigor of a favela. Real big "I want a new room and have two sheets of corrugated steel, a neighbor's wall, and an afternoon" energy.
There are also major parts of it that have benefited from decades of 'this tweak that won't be driver ABI compatible increases efficiency in this use case by measurable but single digit perf'. And yes, there's politics to getting that merged, but the barrier is way lower in Linux. You try a lot of that in how Microsoft builds software and at best you put a target on your back because you just made a lot of work for another team. At worst that amount of differently siloed work just kills the idea in the first place.
That doesn't necessarily mean the Linux implementation is good; it could be that the syscall API is bad and can't be implemented any other way.
The syscall API for such things (fstat(2)) is pretty unobjectionable.
And yet on same hardware, windows gets twice the battery life and idles at about half the power. Maybe NT's way IS better afterall?
Same power efficiency.
And did you come back here an hour later to get another quip in?
Are we looking at the same graph? https://openbenchmarking.org/embed.php?i=1807102-RA-DELLXPSB...
windows is idling at less than half the power! Idle power matters since most laptops spend most of their time idle waiting for the comparatively-slow humans to press keys
> And did you come back here an hour later to get another quip in?
And "quip" is a questionable (bordering on implied ad-hominem) word choice given that my only fault is disagreeing with you.
Actually, it was because NTFS semantics do not match ext semantics and lots of linux apps expect the latter. MS was clear on that...
It's that the NT filesystem stack puts the FS cache between user space and the FS driver, whereas on Linux it sits between FS driver and the block device driver. What that means is that on Linux, you get caching of blocks containing FS metadata for free, but on NT it has to be manually performed. That kills perf when looking at a lot of metadata.
When they say NTFS is to blame, they mean the NT FileSystem stack.
One of the reasons NT kernel is great is it was developed by the same people who developed VMS.
This was true until io_uring, but io_uring is far more useful for far more purposes than overlapped IO.
https://docs.microsoft.com/en-us/windows/win32/api/ioringapi...
Yes really.
Synchronous, multi-threaded is the sane default from any perspective. (Performance, safety, developer convenience, flexibility, you name it.)
P.S. I've been making high-performance "web-scale" services for more than a decade.
There's probably many areas where Linux comes strongly ahead - a much wider array of supported architectures, and even on the windows supported ones Linux scales much better by the virtue of being deployed from the smallest embedded computers to (all of) the largest supercomputers.