-
Notifications
You must be signed in to change notification settings - Fork 33
Linux ARM64 64KB page support (v2 — fix PAS_MAX_OBJECTS_PER_PAGE) #173
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?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -35,22 +35,43 @@ | |||||||||||||
| #define PAS_USE_MARGE_BITFIT_OVERRIDE true | ||||||||||||||
|
|
||||||||||||||
| /* The OS may have a smaller page size. That's OK. */ | ||||||||||||||
| /* On Linux ARM64, kernels may be configured with 64 KiB pages (e.g. RHEL, Oracle Linux). | ||||||||||||||
| All page and granule sizes must be at least as large as the system page size, so use | ||||||||||||||
| 64 KiB minimums on Linux ARM64 to support all possible kernel page configurations. */ | ||||||||||||||
| #if PAS_ARM64 && PAS_OS(LINUX) | ||||||||||||||
| #define PAS_SMALL_PAGE_DEFAULT_SHIFT 16 | ||||||||||||||
| #else | ||||||||||||||
| #define PAS_SMALL_PAGE_DEFAULT_SHIFT 14 | ||||||||||||||
| #endif | ||||||||||||||
| #define PAS_SMALL_PAGE_DEFAULT_SIZE ((size_t)1 << PAS_SMALL_PAGE_DEFAULT_SHIFT) | ||||||||||||||
|
|
||||||||||||||
| #if PAS_ARM64 && PAS_OS(LINUX) | ||||||||||||||
| #define PAS_SMALL_BITFIT_PAGE_DEFAULT_SHIFT 16 | ||||||||||||||
| #else | ||||||||||||||
| #define PAS_SMALL_BITFIT_PAGE_DEFAULT_SHIFT 14 | ||||||||||||||
| #endif | ||||||||||||||
| #define PAS_SMALL_BITFIT_PAGE_DEFAULT_SIZE ((size_t)1 << PAS_SMALL_BITFIT_PAGE_DEFAULT_SHIFT) | ||||||||||||||
|
|
||||||||||||||
| #if PAS_ARM64 && PAS_OS(LINUX) | ||||||||||||||
| #define PAS_MEDIUM_PAGE_DEFAULT_SHIFT 18 | ||||||||||||||
| #else | ||||||||||||||
| #define PAS_MEDIUM_PAGE_DEFAULT_SHIFT 17 | ||||||||||||||
| #endif | ||||||||||||||
| #define PAS_MEDIUM_PAGE_DEFAULT_SIZE ((size_t)1 << PAS_MEDIUM_PAGE_DEFAULT_SHIFT) | ||||||||||||||
|
|
||||||||||||||
| #if PAS_ARM64 && PAS_OS(LINUX) | ||||||||||||||
| #define PAS_MEDIUM_BITFIT_PAGE_DEFAULT_SHIFT 19 | ||||||||||||||
| #else | ||||||||||||||
| #define PAS_MEDIUM_BITFIT_PAGE_DEFAULT_SHIFT 19 | ||||||||||||||
| #endif | ||||||||||||||
|
Comment on lines
+62
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Drop the no-op branch for Both branches define ♻️ Suggested cleanup-#if PAS_ARM64 && PAS_OS(LINUX)
-#define PAS_MEDIUM_BITFIT_PAGE_DEFAULT_SHIFT 19
-#else
-#define PAS_MEDIUM_BITFIT_PAGE_DEFAULT_SHIFT 19
-#endif
+#define PAS_MEDIUM_BITFIT_PAGE_DEFAULT_SHIFT 19📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| #define PAS_MEDIUM_BITFIT_PAGE_DEFAULT_SIZE ((size_t)1 << PAS_MEDIUM_BITFIT_PAGE_DEFAULT_SHIFT) | ||||||||||||||
|
|
||||||||||||||
| #define PAS_MARGE_PAGE_DEFAULT_SHIFT 22 | ||||||||||||||
| #define PAS_MARGE_PAGE_DEFAULT_SIZE ((size_t)1 << PAS_MARGE_PAGE_DEFAULT_SHIFT) | ||||||||||||||
|
|
||||||||||||||
| #if PAS_ARM64 || PAS_PLATFORM(PLAYSTATION) | ||||||||||||||
| #if PAS_ARM64 && PAS_OS(LINUX) | ||||||||||||||
| #define PAS_GRANULE_DEFAULT_SHIFT 16 | ||||||||||||||
| #elif PAS_ARM64 || PAS_PLATFORM(PLAYSTATION) | ||||||||||||||
| #define PAS_GRANULE_DEFAULT_SHIFT 14 | ||||||||||||||
| #else | ||||||||||||||
| #define PAS_GRANULE_DEFAULT_SHIFT 12 | ||||||||||||||
|
|
@@ -131,7 +152,9 @@ | |||||||||||||
|
|
||||||||||||||
| #define PAS_NUM_BASELINE_ALLOCATORS 32u | ||||||||||||||
|
|
||||||||||||||
| #define PAS_MAX_OBJECTS_PER_PAGE 2048 | ||||||||||||||
| /* Must be >= max(page_size >> min_align_shift) across all segregated configs. | ||||||||||||||
| Utility heap uses PAS_INTERNAL_MIN_ALIGN_SHIFT (3) with the small page. */ | ||||||||||||||
| #define PAS_MAX_OBJECTS_PER_PAGE (PAS_SMALL_PAGE_DEFAULT_SIZE >> PAS_INTERNAL_MIN_ALIGN_SHIFT) | ||||||||||||||
|
Comment on lines
+155
to
+157
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Make This is correct for the current constants, but the bound now depends on the small-page config remaining the worst case. Please derive it from the actual max across the segregated configs, or add compile-time checks, so future page/alignment tweaks can't silently undersize it. 🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| #define PAS_MPROTECT_DECOMMITTED PAS_ENABLE_TESTING | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
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.
🧹 Nitpick | 🔵 Trivial
LGTM — this ceiling change belongs here.
It makes the compile-time upper bound safe for 64 KiB Linux ARM64 kernels without perturbing the other ARM64 ports. If CI does not already cover it, a Linux ARM64 / 64 KiB-page builder would be worth keeping on this path so future regressions fail before landing.
🤖 Prompt for AI Agents