But that's inconvenient. You'd much rather be able to write your code in something like C. Any C code compiled by an ordinary compiler is going to access memory (at least for the stack). Writing and maintaining a custom C compiler for this is a lot of work and still comes with a lot of limitations on the C code that it will accept.
So they set up the cache in a way that it will never try to write its contents out to RAM. Then you can use the output of an ordinary C compiler that uses memory accesses and those accesses will all be served by the cache and never touch RAM. They call this "Cache as RAM".
With some work you could probably boot into DOS like this.
https://www.coreboot.org/data/yhlu/cache_as_ram_lb_09142006....
Thank you for sharing!
The optimism is premature. A CPU may flush cache even when it pages exactly the same page. Modern CPUs have too much of completely unfathomable prefetch, and cache coherence logic
If I had infinite money to spend I would build a hypercube out of these bad boys. each "atom" having 6 x8 PCIe connectors (up,down,left,right,front,back) with corner nodes dedicating a x16 PCIe port for I/O in and out of the cube.
Immerse that bad boy in flourinert and contemplates the deepest secrets of the universe :-)
[1] The (original?) Oak Ridge National Labs paper -- https://www.osti.gov/biblio/6487986-parallel-computing-hyper...
[2] https://www.nature.com/articles/313616b0.pdf?proof=trueIn
In the general case, you need log2(N) connections in each direction to turn an NxN or NxNxN topology into a hypercube, so it's not as simple as "left/right". (For example, for N=8, you might connect each position to position xor 1, position xor 2, and position xor 4.)
Edit: oh a bit of searching and it was in the order of thousands of microprocessors. It was called "Connection Machine", you can read about it in Wikipedia[0].
For the electricity grid in today's world, that's over-engineering things. The 60Hz electricity grid doesn't really need anything being changed at more than 600Hz, and considering your CPU core runs at 3,000,000,000Hz, you can totally waste a lot of cycles before you start missing deadlines.
The complexity in modern mulit user operating systems (many processes, a run queue, spin locks) along with modern processors (multi tier memory architecture, micro-code, branch prediction, long stalls for memory access) mean it's very hard to prove that anything will run in finite time.
In addition, the advantage of optimizing at every point is that you can use hardware not designed at the limit of what's possible, likely giving you lower error rates.
[1] https://kx.com/
Disk, Network, or in-memory artifact reference would seem to be much bigger bottlenecks.
The majority of microservices I've written would fit into a system like this just fine.
NodeJS is built around the idea that a single thread of execution is enough for a stupidly large % of backend code. On top of that is ton of infrastructure to deploy slews of 100 line JS microservices that each do one thing.
So, back to basics. No VM, no disk at runtime, a single statically linked binary running on top of nearly bare metal.
Available memory is whatever space the program code doesn't take up.
Ignoring l3 being unaddressable, I wonder if UEFI applications are powerful enough to pull something like image deployment off.
This is probably all less efficient than the current Russian doll system of VMs and containers in use right now, but it is fun to imagine!
If you set the right config registers, you can map the cache to a linear address space and use it like RAM.
I think to do that, you loose access to actual RAM though, so it isn't awfully practical.
>I can see this being used to lift houses.
My evening has been made that much more interesting.
In theory all you'd need is some tight integration with the NIC (or a few of em!) and tiny driver that knows how to DMA to the NIC.
Larger problem of course is that L3 isn't addressable. I wonder how much money a cloud provider would have to pony up to AMD to get an exception to that? :)
A huge # of workloads would fit in 16MB with no storage hanging off. Heck I think every microservice I've ever written could manage that.
There have been some efforts of late to make a cloud first OS, honestly once you remove everything except for "talk to network controller" and "parse JSON", well so long as you don't mind writing in a language that isn't JS, a few MB is plenty for lots of workloads.
I'd love to see what is possible with a tiny runtime/OS in the kilobyte size and running a microservice written in a native language off of each core, everything out of the L3 cache.
I imagine the throughput would be amazing. Single thread per core, e.g. cooperative multitasking. Do this for stream orientated workflows, or even for processing data that is in reasonable sized chunks, it might be screaming fast!