-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Bifurcate megapage caches into compact and non-compact variants #47384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Bifurcate megapage caches into compact and non-compact variants #47384
Conversation
EWS run on previous version of this PR (hash ac8b9b0) |
https://bugs.webkit.org/show_bug.cgi?id=295062 rdar://154434088 Reviewed by NOBODY (OOPS!). Adds new compact megapage caches to basic libpas heaps to support separate heap management for compact pointers. * Source/bmalloc/libpas/src/libpas/pas_basic_heap_page_caches.h: * Source/bmalloc/libpas/src/libpas/pas_create_basic_heap_page_caches_with_reserved_memory.c: (allocate_from_large): (allocate_from_megapages): (pas_create_basic_heap_page_caches_with_reserved_memory): * Source/bmalloc/libpas/src/libpas/pas_heap_config_utils_inlines.h: * Source/bmalloc/libpas/src/libpas/pas_megapage_cache.h:
ac8b9b0
to
2b72d76
Compare
EWS run on current version of this PR (hash 2b72d76) |
pas_megapage_cache_construct( | ||
&caches->small_compact_exclusive_segregated_megapage_cache, | ||
allocate_from_large, | ||
pas_megapage_cache_size_small_compact); | ||
|
||
pas_megapage_cache_construct( | ||
&caches->small_compact_other_megapage_cache, | ||
allocate_from_large, | ||
pas_megapage_cache_size_small_compact); | ||
|
||
pas_megapage_cache_construct( | ||
&caches->medium_compact_megapage_cache, | ||
allocate_from_large, | ||
pas_megapage_cache_size_medium_compact); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unfortunate that we need to allocate 32MiB for each of these (if I'm understanding correctly).
To some extent that doesn't matter since it's all VA, but some amount of that is faulted in -- does this show up at all on memory benchmarks?
pas_megapage_cache_construct( | ||
&caches->small_compact_exclusive_segregated_megapage_cache, | ||
allocate_from_large, | ||
pas_megapage_cache_size_small_compact); | ||
|
||
pas_megapage_cache_construct( | ||
&caches->small_compact_other_megapage_cache, | ||
allocate_from_large, | ||
pas_megapage_cache_size_small_compact); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these strictly need to be separate for functional reasons, or is it just for clarity's sake? I'm OK with "for clarity's sake" I just want to understand if the code would break sans this.
@@ -37,6 +37,29 @@ | |||
#include "pas_reserved_memory_provider.h" | |||
#include "pas_segregated_shared_page_directory.h" | |||
|
|||
static pas_allocation_result allocate_from_large( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand what's going on here. Why does the "allocate_from_megapages" now allocate from the megapage_large_heap, and this function now do what it was doing beforehand?
2b72d76
2b72d76