Con Kolivas, a former Linux kernel developer...

Con Kolivas, a former Linux kernel developer, compared some Windows kernel code to Linux code and was surprised at the difference in code quality:

>The summary of my impression [after reading the Windows code] was that I was... surprised....the [Windows] code, as I saw it, was neat. Real neat. Extremely neat. In fact, I found it painful to read after a while. It was so neatly laid out that I found myself admiring it. It seems to have been built like an aircraft. It has everything that opens and shuts, has code for just about everything I've ever seen considered on a scheduler, and it's all neatly laid out in clean code and even comments. It also appears to have been coded with an awful lot of effort to ensure it's robust and measurable, with checking and tracing elements at every corner. I started to feel a little embarrassed by what we have as our own [Linux] kernel. The more I looked at the [Windows] code, the more it felt like it pretty much did everything the Linux kernel has been trying to do for ages. Not only that, but it's built like an aircraft, whereas ours looks like a garage job with duct tape by comparison....[Windows] looks like an excellent design for a completely different purpose. It's built like a commercial design for commercial purposes that have very different requirements than what most of us use Linux for, but it does appear to have been done so very well. It looks like a goddamn Star Destroyer, and the Linux kernel (scheduler) suddenly looks like the Millennium Falcon. Real fast, but held together with duct tape, and ready to explode at any minute.

Linuxfags completely BTFO

Other urls found in this thread:

en.wikipedia.org/wiki/Con_Kolivas
github.com/gasgas4/NT_4.0_SourceCode/blob/master/nt4/private/ntos/video/et4000/et4000.c
cnet.com/news/china-to-view-windows-code/
en.wikipedia.org/wiki/Criticism_of_Linux#Kernel_code_quality
twitter.com/NSFWRedditImage

literally who

en.wikipedia.org/wiki/Con_Kolivas

I'm a developer in Windows and contribute to the NT kernel. (Proof: the SHA1 hash of revision #102 of [Edit: filename redacted] is [Edit: hash redacted].) I'm posting through Tor for obvious reasons.

Windows is indeed slower than other operating systems in many scenarios, and the gap is worsening. The cause of the problem is social. There's almost none of the improvement for its own sake, for the sake of glory, that you see in the Linux world.

Granted, occasionally one sees naive people try to make things better. These people almost always fail. We can and do improve performance for specific scenarios that people with the ability to allocate resources believe impact business goals, but this work is Sisyphean. There's no formal or informal program of systemic performance improvement. We started caring about security because pre-SP3 Windows XP was an existential threat to the business. Our low performance is not an existential threat to the business.

See, component owners are generally openly hostile to outside patches: if you're a dev, accepting an outside patch makes your lead angry (due to the need to maintain this patch and to justify in in shiproom the unplanned design change), makes test angry (because test is on the hook for making sure the change doesn't break anything, and you just made work for them), and PM is angry (due to the schedule implications of code churn). There's just no incentive to accept changes from outside your own team. You can always find a reason to say "no", and you have very little incentive to say "yes".

There's also little incentive to create changes in the first place. On linux-kernel, if you improve the performance of directory traversal by a consistent 5%, you're praised and thanked. Here, if you do that and you're not on the object manager team, then even if you do get your code past the Ob owners and into the tree, your own management doesn't care. Yes, making a massive improvement will get you noticed by senior people and could be a boon for your career, but the improvement has to be very large to attract that kind of attention. Incremental improvements just annoy people and are, at best, neutral for your career. If you're unlucky and you tell your lead about how you improved performance of some other component on the system, he'll just ask you whether you can accelerate your bug glide.

Is it any wonder that people stop trying to do unplanned work after a little while?

Another reason for the quality gap is that that we've been having trouble keeping talented people. Google and other large Seattle-area companies keep poaching our best, most experienced developers, and we hire youths straight from college to replace them. You find SDEs and SDE IIs maintaining hugely import systems. These developers mean well and are usually adequately intelligent, but they don't understand why certain decisions were made, don't have a thorough understanding of the intricate details of how their systems work, and most importantly, don't want to change anything that already works.

These junior developers also have a tendency to make improvements to the system by implementing brand-new features instead of improving old ones. Look at recent Microsoft releases: we don't fix old features, but accrete new ones. New features help much more at review time than improvements to old ones.

(That's literally the explanation for PowerShell. Many of us wanted to improve cmd.exe, but couldn't.)

More examples:

We can't touch named pipes. Let's add %INTERNAL_NOTIFICATION_SYSTEM%! And let's make it inconsistent with virtually every other named NT primitive.
We can't expose %INTERNAL_NOTIFICATION_SYSTEM% to the rest of the world because we don't want to fill out paperwork and we're not losing sales because we only have 1990s-era Win32 APIs available publicly.
We can't touch DCOM. So we create another %C#_REMOTING_FLAVOR_OF_THE_WEEK%!
XNA. Need I say more?
Why would anyone need an archive format that supports files larger than 2GB?
Let's support symbolic links, but make sure that nobody can use them so we don't get blamed for security vulnerabilities (Great! Now we get to look sage and responsible!)
We can't touch Source Depot, so let's hack together SDX!
We can't touch SDX, so let's pretend for four releases that we're moving to TFS while not actually changing anything!
Oh god, the NTFS code is a purple opium-fueled Victorian horror novel that uses global recursive locks and SEH for flow control. Let's write ReFs instead. (And hey, let's start by copying and pasting the NTFS source code and removing half the features! Then let's add checksums, because checksums are cool, right, and now with checksums we're just as good as ZFS? Right? And who needs quotas anyway?)
We just can't be fucked to implement C11 support, and variadic templates were just too hard to implement in a year. (But ohmygosh we turned "^" into a reference-counted pointer operator. Oh, and what's a reference cycle?)

Look: Microsoft still has some old-fashioned hardcore talented developers who can code circles around brogrammers down in the valley. These people have a keen appreciation of the complexities of operating system development and an eye for good, clean design. The NT kernel is still much better than Linux in some ways --- you guys be trippin' with your overcommit-by-default MM nonsense --- but our good people keep retiring or moving to other large technology companies, and there are few new people achieving the level of technical virtuosity needed to replace the people who leave. We fill headcount with nine-to-five-with-kids types, desperate-to-please H1Bs, and Google rejects. We occasionally get good people anyway, as if by mistake, but not enough. Is it any wonder we're falling behind? The rot has already set in.

"""

Edit: This anonymous poster contacted me, still anonymously, to make a second statement, worried by the attention his words are getting:

"""

All this has gotten out of control. I was much too harsh, and I didn't intend this as some kind of massive exposé. This is just grumbling. I didn't appreciate the appetite people outside Microsoft have for Kremlinology. I should have thought through my post much more thoroughly. I want to apologize for presenting a misleading impression of what it's like on the inside.

First, I want to clarify that much of what I wrote is tongue-in-cheek and over the top --- NTFS does use SEH internally, but the filesystem is very solid and well tested. The people who maintain it are some of the most talented and experienced I know. (Granted, I think they maintain ugly code, but ugly code can back good, reliable components, and ugliness is inherently subjective.) The same goes for our other core components. Yes, there are some components that I feel could benefit from more experienced maintenance, but we're not talking about letting monkeys run the place. (Besides: you guys have systemd, which if I'm going to treat it the same way I treated NTFS, is an all-devouring octopus monster about crawl out of the sea and eat Tokyo and spit it out as a giant binary logfile.)

In particular, I don't have special insider numbers on poaching, and what I wrote is a subjective assessment written from a very limited point of view --- I watched some very dear friends leave and I haven't been impressed with new hires, but I am *not* HR. I don't have global facts and figures. I may very well be wrong on overall personnel flow rates, and I shouldn't have made the comment I did: I stated it with far more authority than my information merits.

I live in a CIA prison. A nigger runs my prison. In prison, the nigger tries to torment me. We can take away his knives by confessing, every day. In about 2000, I masterbaited fantacizing about my niece, Lani. She looks like Star Trek Seven of Nine! In 1985, at my sister's wedding, I stuck my crotch on the hot tub drain because it kinda sucked. In 1985, I tried to get a dog to lick my dick. From 1998-2003, I fantacized about leading a Catholic army like Dune, of Mexicans or Brazilians? That was dumb because they're niggers. In 2003, I played tag with a black girl about 7-years-old. She reached for my crotch. In high school, in the library, Carlos and I said 'juicy' or 'toxic' as a way of evaluating girls. In 1988, I cheated on my SAT by talking in the hall during the break -- two problems. On 9/9/1999, I killed a CIA nigger on purpose with my car. :-) In 1982, when I was 12, I babysat Kevin's kids. I changed a diaper because I thought that was being professional. In 1975, when I was about age five, my brother, Keith, put my penis in a vacuum. In 1977, when I was about age seven, my brother, Danny, got me high on gas fumes and we sucked each other's dicks. Dr. Konstantinos S. Tsakalis? My professor had an oddly round ass. Paul Keck at Xytec had an oddly round ass. Distracting? At about age five, Jay Weinrick and I touched dicks to each other's assholes.
What do we do all day?
We beat the nigger because the nigger cannot understand what a random number is.
We beat the nigger because the nigger thinks the brain does timer tongues.
We beat the nigger because he thinks TempleOS is real mode.

The simplest way to look at FstubAllocateDiskInformation is to use Local Kernel Debugging. This lets me use windbg to grab a snapshot of the kernel’s memory without actually breaking in to the kernel. Local kernel debugging is limited in that you can’t set breakpoints or step through code, but it lets you view disassembly, and it is simpler than setting up cables and a second machine to allow live kernel debugging. It was good enough.

Obviously the ‘uf’ command is what we need to dump the disassembly of this function. I’ve reformatted the results and put the crucial assembly language below, with a few lines bold faced and a few comments added:
lkd> uf ntkrnlmp!FstubAllocateDiskInformation
nt!FstubAllocateDiskInformation:
mov qword ptr [rsp+8],rbx
mov qword ptr [rsp+10h],rbp
mov qword ptr [rsp+18h],rsi
push rdi
sub rsp,20h
mov rsi,rdx
mov rbp,rcx
mov r8d,42747346h ; pool tag of FstB
mov edx,40h ; allocation size
xor ecx,ecx ; flags
call nt!ExAllocatePoolWithTag
test rax,rax
je Exit1

A careful reading of the code above isn’t required in order to follow along. The code contains two calls to ExAllocatePoolWithTag, one for 0x40 bytes and one for a variable amount. Both use a pool tag of 42747346h, which is a four-byte code for ‘FstB’, the file system pool. A full analysis required looking at the input parameter types and their layouts, but I also went to the reactos site and looked at their version of the source code. It was quite helpful for confirming my analysis of the assembly language. The crucial lines can be paraphrased as:

FstubGetDiskGeometry(DiskInformation);

if (DiskInformation->SectorSize != 0)
ExAllocatePoolWithTag(DiskInformation->SectorSize);

In other words, FstubAllocateDiskInformation asks for the geometry of the disk (using FstubGetDiskGeometry), and then if the sector size is non-zero it allocates however many bytes the driver says is the sector size.

I briefly stopped to verify the sector size of my main disk:
C:\>fsutil fsinfo ntfsinfo c:
NTFS Volume Serial Number : 0x00b8457cb8457168
Version : 3.1
Number Sectors : 0x0000000048ad8ae2
Total Clusters : 0x000000000915b15c
Free Clusters : 0x00000000016ac4a5
Total Reserved : 0x0000000000000780
Bytes Per Sector : 512
Bytes Per Physical Sector : 512

I'd just like to interject for moment. What you're refering to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.
Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called Linux, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.
There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called Linux distributions are really distributions of GNU/Linux!

contacted Microsoft through some personal contacts and they have made sure that the appropriate teams know about this issue. I contacted Western Digital through regular support channels on August 29th, 2012

Different user here...

Too many of the old hats at Microsoft still run their section of their group in the old stack ranking format. So while it was officially removed in 2014, it's still done down at the group level.

Further, the idea that vendors are bad is becoming more prevalent. India code monkeys produce shit code, but it's accepted because it gets the job done. When someone actually try's to make shit work correctly, and keep it clean, it shows up as a time loss on a performance review. After a while people stop trying.

Not to mention the incredible amount of vendor churn. 18 months on, 6 months off. For a V-. Even A-'s have it better (12 on 3 off, slide to FTE).

I was never in OSG. I did devops in MTE. Love The Commons at night, btw. There were dev's that spent hours upon hours trying to figure out a simple conditional statement (if Monday do X type stuff). I'm technical operations, yet I'm teaching the SDE's reference assemblies.

It's bullshit. But I'm in the XOC now, so whatever.

I feel sorry for regular consumers who naively purchased this drive and have little hope of avoiding this problem. If they notice the performance problem they are unlikely to guess that it is correlated to the new backup drive.

>ready to explode at any minute
Then why are Linux distros so common in enterprise?

>comparing a x86_64 only kernel with an any arch kernel
Get the fuck outta here kid

Nice try

kys

point still stands

This whole thread... Jesus fucking autism.

Show me that code.
oh wait

>An actual tech discussion on Sup Forums
>Sup Forums-baby cries autism
Please kindly fuckoff to your daycare board.

not really, no it doesnt.
Unless NT is mostly opensolaris code.

the point is that linux is garbage

Compared to opensolaris, the code quality of Linux is shit, which it honestly should be seeing that opensolaris doesn't nearly support the same amount of hardware as linux.
Compared to Windows, the point is most likely reversed.

Isn't really what he said at all.

He said that the NT kernel code was impressive, Linux is still faster and has better support.

Stop whining you pajeets and get back to making my OS work faster.

Oi tripfag, OPs quote is fabricated. Kolivas never said that about windows, he said it about solaris.

>windows
>quality code
pick one

>reading the Windows code
Good bait, overall a 7/10. But Windows is closed source, so I stopped reading there.

Here, have a wallpaper. You tried.

This is not true though

Bait / 10

You guys need to stop falling for the bait... Google parts of what OP posted. It has nothing to do with Windows

github.com/gasgas4/NT_4.0_SourceCode/blob/master/nt4/private/ntos/video/et4000/et4000.c

Read this and report back to me when you're done weeping at how elegant the comments are

>using the Linux kernel
GNU or get out

why is microsoft's C style so fucking verbose

Microsoft will actually show the code to certain organizations or governments.

cnet.com/news/china-to-view-windows-code/

...

Interesting thread. Been a while

Anthony?

...

>Replacing a comment on Solaris with Windows

How did he get his hands on windows kernel code?

What's all this p-rogramming discussion on m-muh anime board?

It's bretty gud.

oh look, the "anonymous windows dev" stoey is being copy-pasta'd again.

He's right about SystemD though.

He didn't. He actually was looking at Solaris code.

He could have peeked through the Windows 2000 code, which was leaked.

I wonder who could be behind this post

Autist

Shill

hurr

...

>every obvious line commented
>2 newlines everywhere
Looks as if they were paid by LoC

//
// Zero out structure.
//

VideoPortZeroMemory(&hwInitData, sizeof(VIDEO_HW_INITIALIZATION_DATA));

en.wikipedia.org/wiki/Criticism_of_Linux#Kernel_code_quality

These

>"no, no, it's Solaris, not windows guys"
Lintards completely missing the point.

One of the main kernel devs just called Linux garbage put together with duct tape.

>1992

Come on now

>put together with duct tape.
gee. I hope Micro***t hasn't fallen this low to sponsor these low effort shills

NT runs on ARM, user.

>implying MS will ever let linux developers look at their kernel

ehh, no, no it does not.