3 ms·
I suppose I should say ask me anything. This was written at a time when the Linux scheduler was a simple process loop. So Linux would come to a crawl when the
by CalChris 5y ago
I suppose I should say ask me anything.
This was written at a time when the Linux scheduler was a simple process loop. So Linux would come to a crawl when the process count hit like 64. I figured out the underlying but I didn't submit a patch. Then I really started looking at the problem, and the result of that investigation was this article which was/is a bit bombastic but a good tutorial on issues with caches nonetheless.
Weird that it's on the front page lo these many years later.
- rramadass 5y agoI posted this because i saw Drepper's paper on Memory make its appearance again and had always thought this short write-up (even though aimed at Kernel Programmers) was/is far more relevant. Maybe update the article to current times into two parts? :-) One explaining general Cache principles and how an "Application Programmer" can take advantage of them and the other on how the Linux Kernel does it; Theory and Practice! PS: The Schimmel book (which you have also referenced) is the only place where i have seen all the cache issues explained comprehensively and clearly.
- CalChris 5y agoThanks, any comparison to Drepper is a distinction. I'd like a tool, maybe part of Cachegrind, which said dude, this instruction is thrashing this L2 set. A profiling virtual machine (Valgrind) is kind of the ultimate lookaside to do this. It could easily (if expensively) evaluate these kinds of queries at each load/store. I think it's better to be able to find these problems than understand them from first principles. I think something like Computer Organization And Design could have a section on cache programming and maybe a problem set. But if I was to revisit this, I'd write something like A Bestiary of Caches which would delineate all of the different caches in a modern CPU. Things like branch prediction target caches, the micro-op cache, the LSD, ... but all in one place.
- rramadass 5y ago>But if I was to revisit this, I'd write something like A Bestiary of Caches which would delineate all of the different caches in a modern CPU. Things like branch prediction target caches, the micro-op cache, the LSD, ... but all in one place. You said it; now you gotta do it :-) PS: Jokes aside, it is a sincere request. Most folks don't know about these issues and if they do, it is piecemeal, bringing them all together in one place by somebody who understands it all would be invaluable.