4 ms·
What you really need is stick a virtual memory manager on top of NVM instead of RAM. In this case NVM works like disk and RAM as the same time. In your file sys
by guard-of-terra 14y ago
What you really need is stick a virtual memory manager on top of NVM instead of RAM.
In this case NVM works like disk and RAM as the same time. In your file system you just have a /ram file which is used as system memory.
Then, fun things start to happen: You no longer need disk buffers, since your RAM is your disk. And mmap()ing no longer consumes "RAM" because you just map a part of your file to whatever virtual address you want. You need no swap. You never have to swap in or out. You never have to sync your disks or observe buffer dirtiness (if only on CPU cache level) because your buffer is a part of your file - once you write to it the file is already updated.
Of course, software will have to adapt: prefer mmap()ing file to read()ing one; use persistent memory structures. The goal is to minimize copy-on-write by either read-only access or safe in place data transformation.
- carterschonwald 14y agoWhile I look forward to that future, realistically nvm ram is going to be at least as pricey as ssds or volatile ram, which means that a more likely in between approach that tries To minimize the amortized io between fast nvm (our ram replacement) and cheap and relatively slow nvm (hd or ssd).
- guard-of-terra 14y agoIf it would cost as SSDs do, it's pretty simple then: you mount NVM as /, and /var & /srv are still on disk. All your programs lose start-up time and most of swapping. If it would cost more, you can use it as a persistent block cache (that survives reboot), but it doesn't make much economic sense since nobody is willing to pay money for just faster start-up and warm-up after reboot. If you have 8G of NVM, you could just read 8G off disk in something like 30 sec and be settled with regular RAM.