4 ms·
> how you can guarantee that you've fixed up all pointers to an unmapped virtual page so you can reuse it. Maybe they don't. amd64 effectively has a 48-bit ad
by bnoordhuis 16y ago
> how you can guarantee that you've fixed up all pointers to an unmapped virtual page so you can reuse it.
Maybe they don't.
amd64 effectively has a 48-bit addressing limit. You can unmap 1,000 4K pages each second for over two years before you need to reuse a page address.
- modeless 16y agoAn interesting idea, but I'd imagine the tables you need to maintain to fixup pointers would become prohibitively large before you ran out of address space.
- binaryfinery 16y agoOnly if you had a very large number of undead per live instance.
- bnoordhuis 16y agoPerhaps the VM doesn't use tables but a pointer remapping algorithm, something along the lines of (page_address * large_prime_number) mod 2^48.
- modeless 16y agoThe problem is you're not just moving whole pages, you're moving and compacting the objects within that page. Each object in the page has a new offset in the new page (or pages).
- iwwr 16y agoSo does that mean there are conceiveable advantages to using the full 64bit addressing scheme? What about 128 bits?
- wingo 16y agoNo, that means that only having 48 bits of physically addressable memory gives you the ability to have many times that amount of virtual memory -- and that virtual memory can be used to implement this fun page-faulting shenanigans without worrying about taking up any real memory address space. You have enough virtual memory for all your physical memory, and these tricks, and then some.
- danvet 16y agoIf I'm reading the article correctly, they do fix up all the pointers on the next gc run. For every scanned pointer just check first whether it points to a stale page (and update it), then do the liveness marking. btw, they're using 2mb pages to cut down on page faulting overhead. And they're talking about terabytes of allocations per second (because they're compacting the first gc generation with this scheme, too), so virtual memory deallocation needs to happen somewhat timely. Furthermore at least the linux kernel never deallocates page tables, so no longer used virtual memory is definitely not free.