5 ms·
I worked at IBM Austin on the performance team when the Mach-based IBM Microkernel/Workplace OS was ongoing. (Ask me anything! :-)) Performance was the big pro
by mcguire 7y ago
I worked at IBM Austin on the performance team when the Mach-based IBM Microkernel/Workplace OS was ongoing. (Ask me anything! :-))
Performance was the big problem. (At one point, a disk read was CPU-bound.)
1. The Mach Interface Generator (mig) generated code with wildly different performance, with no obvious relationship to the mig spec.
2. Context switching is always the big topic, but it's a red herring. Our problem was primarily data transfer; copy-on-write took so long to set up that it was frequently cheaper to just do the copy.
3. Making a syscall to get the current PID is a stupid idea.
- mlinksva 7y ago> At one point, a disk read was CPU-bound. That sounds impressive. Could you say more about how/why?
- mcguire 7y ago1. Keep in mind that the programmers had swallowed gallons of the multi-server microkernel koolaid, so the flow was user code -> mk -> file server -> mk -> device driver and back. 2. Someone used the wrong magic keywords in the mig spec, causing poor message send-receive structure and code. 3. The same someone, IIRC, set up the copy on write memory management for each page, rather than one big buffer. The latter would still be slower than just copying, but geeze. 4. There was something wrong with the driver at the time; I never heard what. 5. In fairness, there was some overhead from our monitoring.
- fc_barnes 7y agoIs there some relationship between Mach's poor performance and the ability of macOS to remain functional in low-memory situations? Linux has been called out recently for becoming unusable when free memory is low. Using both, I can say that the Mac is hands-down a better OS for desktop use where having the system not freeze is way more important than a 70% slowdown in file transfer rate. Why is the Mac so much better under low memory conditions than Linux? Is it the kernel, and if so, is there an inherent trade-off between low memory performance and other kinds of performance? If there is a trade-off, would reworking the Linux kernel to function better under low memory conditions also create a way forward for a non-dbus, non-systemd, yet modern Linux?
- curt15 7y agoI seem to recall that back when I used Windows back in XP era when memory was limited, the page file would sometimes grow to a few hundred MB without GUI responsiveness suffering too much. Does Windows or Mac protect certain processes from being swapped?
- Animats 7y agocopy-on-write took so long to set up that it was frequently cheaper to just do the copy. Right. QNX just copied for interprocess communication. Mach did lots of messing with the MMU to create temporary shared pages. That seemed to be a lose. * What you want for interprocess communication in a microkernel is something that works like a function call - send data, wait for reply. If you have to build that out of unidirectional messages, it means more trips through the CPU dispatcher, and probably going to the end of the line waiting for a turn at the CPU. Call-like approach: Process A calls process B, control transfers immediately from A to B, B returns to A, control transfers immediately to process A. No need to look for the next task to run; who runs next is a no-brainer. Pipe-like approach: A sends to B, both are active for a moment, A soon blocks on a lock, B wakes up and does its thing, B sends to A, both are active for a moment, B soon blocks on a lock. A and B fight for the CPU. The "going to the end of the line" effect is that when other tasks want the CPU, the pipe-like approach means other tasks get a chance to run during the handoff. The effect is that message passing performance falls off a cliff when you're CPU-bound. QNX used a call like approach (MsgSend/MsgReceive), while Mach used something more like pipe I/O. * Mach started from the BSD code base. Trying to build a microkernel by hacking on a macrokernel didn't end well. Microkernels are all about getting the key primitives at the bottom working very fast and reliably. There was an eventual rewrite, but I gather that BSD code remained.
- a1369209993 7y agoTechnically there's no reason why write can't context switch directly to a process that's blocked on read (or, less commonly, vice versa). That only solves half the problem though; if you want pure pipe-like IO, you'd also need a single system call that combines write with select/poll/equivalent so the caller can immediately become blocked waiting for the return message.
- Animats 7y agoThat runs into a problem on a quick reply. Process A does the write on pipe AB, then gives up the CPU to B. A is still in ready to run state. B quickly generates a reply and writes it to pipe BA. But there's no read pending on pipe BA yet. So both processes are now in ready to run state, contending for the CPU, along with anything else that needed it. There's an alternative - unbuffered pipes. This is like a Go channel of length 0 - all writes block until the read empties the channel. This is better from a CPU dispatching perspective, in that a write to a channel implies an immediate transfer of control to the receiver. Of course, Go is doing this in one address space, not across a protection boundary. The QNX approach worked well for service-type requests. You could set up a service usable by multiple processes. Each request contained the info needed to send the reply back to the caller. The service didn't have to open a pipe to the requestor. This even understood process priority, so high priority requests were serviced first, an essential feature in a hard real time system.
- ksec 7y ago>I worked at IBM Something completely unrelated to Mach, what do you think of IBM then, IBM now, and IBM's future.
- mcguire 7y agoIBM then was essentially "the loudest person gets to be in charge." Larry Loucks was very loud. After spending some time with the OS/2 Workplace Shell usability group, I spent time with Taligent and then the Workplace OS. I'm having "DASD" flashbacks typing this. Then I left for grad school and UT Austin for a good ten years, going back to IBM to work on something called xCP and digital media encryption. That was mostly after IBM became a pure consulting company, and was a cluster fuck, too. (The entire Pervasive Computing division went down with me. My boss ended up in the Lotus division.) Don't work for IBM. Don't buy IBM. After I get done here, I'm washing my cell phone out with Listerine.
- dralley 7y agoWhat do you think about the hypothetical that Ginni Rometty gets replaced by Jim Whitehurst?
- glhaynes 7y agoI worked at IBM Austin on the performance team when the Mach-based IBM Microkernel/Workplace OS was ongoing. (Ask me anything! :-)) Kind of off-topic, but, every once in a while, I think of Workplace OS and how it was this mystical product that was going to be The Future (especially to us OS/2 nerds!) and how it nearly never even gets mentioned anymore these days. I'd love to read the reminisces of you or your team members.
- kev009 7y agoI heard DEC/Compaq ended up basically rewriting the whole thing in OSF/Digital Unix/Tru64. Anyone with stories on that kernel?
- mcguire 7y agoIsn't that the "OSF MkLinux" thing?
- skissane 7y agoQuestions: The OS/2 personality was the only one that shipped, right? (Was its DOS and Windows compatibility provided by separate personalities, or provided by the OS/2 personality?) What other personalities were being developed, and how far along were they in development before being cancelled? I know IBM executives talked about AIX, OS/400, classic MacOS and Taligent personalities, but did any development work happen on those or were they just vaporware? Wikipedia says OS/2 for PPC shipped with "IBM Microkernel 1.0" (based on Mach), with plans for a "IBM Microkernel 2.0" which never shipped? Was 2.0 planned as a major change from 1.0, or just an incremental evolution?
- mcguire 7y agoThe OS/2 personality shipped? (For once in my career, I didn't ride the dead horse into the ground.) When I left, the performance group I was with was breaking up, and the Workplace OS was very far from a releasable state. I assume DOS and Windows compatibility would come from the features in OS/2. My primary task was to write and run benchmarks comparing Workplace OS personalities to native code. Primarily OS/2 and AIX, which were pretty far along, but later Windows NT. Classic MacOS and OS/400 were mentioned, but I never saw any work on them. Taligent was dead as a door nail by that time (I did ride that project into the ground), by which I mean it had been converted to a C++ utility library. We were just benchmarking and telling the devs in Boca Raton, "Non't do that. No, don't do that. Here's how you do it. Stop it." I don't know about the roadmap beyond the initial personalities. Was OS/2 for PPC (are you sure it shipped?) well known for being hideously slow?
- skissane 7y ago> The OS/2 personality shipped? Well, apparently it did: http://www.os2museum.com/wp/os2-history/os2-warp-powerpc-edition/ http://www.os2museum.com/wp/os2-history/os2-warp-powerpc-edi... Some "abandonware" website is even offering it for download: https://winworldpc.com/product/os-2-3x/30-powerpc-edition https://winworldpc.com/product/os-2-3x/30-powerpc-edition > well known for being hideously slow? I don't think it was "well-known" for anything :) But, not having used it myself, the blog post I cite above says the performance was "surprisingly good" and that "all things considered, responsiveness quite good for a 100MHz CPU"