4 ms·
> mapping the shared cache at a different address for every process (which, unless done carefully, would kill the benefits of it being in shared memory as the p
by Hackbraten 6y ago
> mapping the shared cache at a different address for every process (which, unless done carefully, would kill the benefits of it being in shared memory as the pages would all be dirtied)
Assume foo.dylib and bar.dylib are system libraries, both live in the shared cache, and foo links to bar. Both are loaded and mapped to a running user-space process.
If foo links to bar, then there must be a symbol table somewhere in physical memory with an entry that points to bar’s TEXT.
That symbol table is part of the shared cache, right? Doesn’t it already follow that bar’s TEXT needs to be at the same virtual address in every process?
- saagarjha 6y ago> That symbol table is part of the shared cache, right? Doesn’t it already follow that bar’s TEXT needs to be at the same virtual address in every process? Yes, and this is how the shared cache works. If you wish to map the shared cache elsewhere there would have to be another copy of it in memory, which is why this would be a massive pessimization if done without designing for it. Perhaps you might have some idea as to what would need to change to make this not be as bad.
- Hackbraten 6y agoGot it, thanks!