4 ms·
>I feel like it's 1990 again and we are debating whether the context switch overhead of processes on UNIX is worth it. Worth noting are modern (gen2/3, L4 onwa
by snvzz 9y ago
>I feel like it's 1990 again and we are debating whether the context switch overhead of processes on UNIX is worth it.
Worth noting are modern (gen2/3, L4 onwards) microkernel context switch costs.
This article has a neat table in it. Third page.
http://sigops.org/sosp/sosp13/papers/p133-elphinstone.pdf http://sigops.org/sosp/sosp13/papers/p133-elphinstone.pdf
In contrast, Linux takes whole microseconds. This should be carefully considered when thinking about multiserver architecture overhead.
- aidenn0 9y agoI'm guessing those are uncontended timings. I haven't been able to think of a good way to do it, but I'd like to see contended timings compared as well. Having a fast fast-path is great for many reasons (a fast fast-path will reduce contention all on its own, and systems can be designed to minimize contention), but the contended case can be much slower on some microkernels, and I have no idea what the overhead is on linux.
- gue5t 9y agoSee this presentation about Google's scheduler patches, which claims the major overhead is logic in the scheduler (pg16): http://www.linuxplumbersconf.org/2013/ocw/system/presentations/1653/original/LPC%20-%20User%20Threading.pdf http://www.linuxplumbersconf.org/2013/ocw/system/presentatio...
- snvzz 9y agoThis is interesting. I wonder what's keeping this kind of work from being mainlined. The present (as shown in the slides) Linux context switch times are painfully long.
- gue5t 9y agoUnless I'm mistaken, Google isn't interested in upstreaming these changes. A quick search of lmkl.org doesn't show any hits for the switchto_... APIs. I'd love to hear otherwise or in more detail from someone at Google. It's frustrating to have to do archaeology just to guess what the state of the art is. Isn't sharing your findings part of "organizing the world's information"?
- noir_lord 9y ago"organizing the world's information" (when it's to our competitive advantage). It's the bit on the end that sounds a lot less noble.
- appleflaxen 9y agowow; that's a good example of why GLP v3 has value to end users of free software: the GPL2 allows them not to share improvements. The GPL3 requires the source code to be available, if those machines are used to serve results to users.
- snvzz 9y agoWouldn't that be the Affero license?
- snvzz 9y ago>uncontended timings In the case of seL4, they are WCET (Worst Case Execution Time). That's as "contended" as it can possibly get. They do provide formal proof of WCET, so these numbers are solid.
- aidenn0 9y agoAre those really WCET? A L3 miss on an i7 4770 is ~60ns and they show 90ns total execution time. If that's true it's incredibly impressive. [edit] Also formal WCET analysis for various IPCs is really great and not something you can "bolt on" to a kernel not designed for it.
- snvzz 9y agoYou might want to look into: http://ts.data61.csiro.au/projects/seL4/ http://ts.data61.csiro.au/projects/seL4/ Specifically: Bernard Blackham, Yao Shi, Sudipta Chattopadhyay, Abhik Roychoudhury and Gernot Heiser Timing analysis of a protected operating system kernel IEEE Real-Time Systems Symposium, pp. 339-348, Vienna, Austria, November, 2011 --- TL;DR: They assume worst case for cache misses. e.g.: "The latency of a read or write to physical memory on this platform was measured to be 80–100 cycles; in the static analysis we assume a 100-cycle penalty for all cache misses."
- aidenn0 9y agoThat would mean ~2 cache lines are accessed for an IPC call, plus another 130 cycles for instructions. That's very impressive.