Commit Graph

5 Commits

Author SHA1 Message Date
phil pizlo
a9137d1ae0 Verse heap medium pages should have out-of-line headers.
Libpas supports medium pages that have inline or out-of-line headers. Out-of-line headers are better. Prior to this change, the Verse heap used inline medium page headers, for silly complex reasons (a prior design of the Verse heap would have benefited from it). Now, it's the opposite, the Verse heap layout makes out-of-line medium page headers easy, since the chunk map can be used as the page header map. So, this change switches medium pages to use out-of-line headers via chunk map lookup.

I have a hunch this'll make SOL-4903 a little easier to do. And, it's worth doing this anyway, since the inline medium page headers are a holdover from an abandoned design.

#rb saam.barati

[CL 27096248 by phil pizlo in ue5-main branch]
2023-08-14 23:12:53 -04:00
phil pizlo
f8234b094c Teach the Verse heap to allocate its underlying chunks committed whenever possible.
This achieves two things:

- Verse programs that first grow their heap will do half the syscalls on Windows to allocate fresh memory (before: reserve syscall then commit syscall, now: single reserve and commit syscall).

- The verse_heap logic now does a better job using libpas conventions, which simplifies the code some.

#rb saam.barati

[CL 26871490 by phil pizlo in ue5-main branch]
2023-08-05 14:41:26 -04:00
phil pizlo
0b56d66706 Move libpas out of restricted and make it available as a malloc on Windows.
Testing libpas's perf as a malloc already revealed some useful data about how the allocator performs on Windows (like that reserving and committing memory in separate syscalls is surprisingly expensive). Even if we don't use libpas as a UE malloc, running it in that mode is likely to reveal opportunities for improvement in those parts of libpas that the Verse GC uses.

The biggest change to libpas is introducing the global physical page cache, which is a heap of memory that starts out committed but gets tracked by the large sharing pool - so it will get decommitted after 300ms of nonuse. This means that if you're growing the heap, we allocate committed memory (single syscall to reserve and commit), but we still have a path to decommitting alignment slop. This made a 5-10% difference in VerseTestVMCmd's running time.

Resubmitting after making Core only depend on libpas on Windows (since for now, I only expose libpas as a malloc on Windows).

#rb andriy.tylychko
#rb andrew.scheidecker
#rb danny.couture

[CL 26811655 by phil pizlo in ue5-main branch]
2023-08-03 11:09:40 -04:00
phil pizlo
b0e979bf58 [Backout] - CL26794980
[FYI] phil.pizlo
Original CL Desc
-----------------------------------------------------------------
Move libpas out of restricted and make it available as a malloc on Windows.

Testing libpas's perf as a malloc already revealed some useful data about how the allocator performs on Windows (like that reserving and committing memory in separate syscalls is surprisingly expensive). Even if we don't use libpas as a UE malloc, running it in that mode is likely to reveal opportunities for improvement in those parts of libpas that the Verse GC uses.

The biggest change to libpas is introducing the global physical page cache, which is a heap of memory that starts out committed but gets tracked by the large sharing pool - so it will get decommitted after 300ms of nonuse. This means that if you're growing the heap, we allocate committed memory (single syscall to reserve and commit), but we still have a path to decommitting alignment slop. This made a 5-10% difference in VerseTestVMCmd's running time.

#rb andriy.tylychko
#rb andrew.scheidecker
#rb danny.couture

[CL 26795519 by phil pizlo in ue5-main branch]
2023-08-02 20:39:57 -04:00
phil pizlo
49b3585fa3 Move libpas out of restricted and make it available as a malloc on Windows.
Testing libpas's perf as a malloc already revealed some useful data about how the allocator performs on Windows (like that reserving and committing memory in separate syscalls is surprisingly expensive). Even if we don't use libpas as a UE malloc, running it in that mode is likely to reveal opportunities for improvement in those parts of libpas that the Verse GC uses.

The biggest change to libpas is introducing the global physical page cache, which is a heap of memory that starts out committed but gets tracked by the large sharing pool - so it will get decommitted after 300ms of nonuse. This means that if you're growing the heap, we allocate committed memory (single syscall to reserve and commit), but we still have a path to decommitting alignment slop. This made a 5-10% difference in VerseTestVMCmd's running time.

#rb andriy.tylychko
#rb andrew.scheidecker
#rb danny.couture

[CL 26795044 by phil pizlo in ue5-main branch]
2023-08-02 20:27:51 -04:00