[Git][ghc/ghc][wip/hugepages] 2 commits: fixup! rts: Implement support for 2MB hugepages
Teo Camarasu (@teo)
gitlab at gitlab.haskell.org
Tue Aug 6 09:37:58 UTC 2024
Teo Camarasu pushed to branch wip/hugepages at Glasgow Haskell Compiler / GHC
Commits:
06cfa074 by Teo Camarasu at 2024-08-06T10:19:55+01:00
fixup! rts: Implement support for 2MB hugepages
- - - - -
709302ec by Teo Camarasu at 2024-08-06T10:37:45+01:00
drop invalid assertion
- - - - -
2 changed files:
- rts/RtsFlags.c
- rts/posix/OSMem.c
Changes:
=====================================
rts/RtsFlags.c
=====================================
@@ -556,8 +556,10 @@ usage_text[] = {
#endif
" -xq The allocation limit given to a thread after it receives",
" an AllocationLimitExceeded exception. (default: 100k)",
+#if defined(HUGEPAGE_FLAGS)
" -xH Try to use hugepages to allocate memory.",
"",
+#endif
#if defined(USE_LARGE_ADDRESS_SPACE)
" -xr The size of virtual memory address space reserved by the",
" two step allocator (default: 1T)",
@@ -1861,7 +1863,11 @@ error = true;
case 'H':
OPTION_UNSAFE;
+#if defined(HUGEPAGE_FLAGS)
RtsFlags.GcFlags.hugepages = true;
+#else
+ errorBelch("Program not compiled with hugepages support.");
+#endif
break;
default:
=====================================
rts/posix/OSMem.c
=====================================
@@ -60,7 +60,6 @@
# endif
#endif
-
#if !defined(darwin_HOST_OS)
# undef RESERVE_FLAGS
# if defined(MAP_GUARD)
@@ -74,8 +73,10 @@
# endif
#endif
+#if defined(HUGEPAGE_FLAGS)
static int huge_tried = 0;
static int huge_failed = 0;
+#endif
static void *next_request = 0;
@@ -692,10 +693,6 @@ void osDecommitMemory(void *at, W_ size)
if(r < 0)
sysErrorBelch("unable to make released memory unaccessible");
#endif
- if(RtsFlags.GcFlags.hugepages) {
- ASSERT( ((HUGEPAGE_SIZE - 1) & (uintptr_t)at) == 0);
- ASSERT( ((HUGEPAGE_SIZE - 1) & size) == 0);
- }
#if defined(MADV_FREE)
// See Note [MADV_FREE and MADV_DONTNEED].
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4a3fff1be01356b69c44175a0b8722101593ccdf...709302ec193b0531c00c1447fcfc8b0a995df29c
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4a3fff1be01356b69c44175a0b8722101593ccdf...709302ec193b0531c00c1447fcfc8b0a995df29c
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240806/c38ab973/attachment-0001.html>
More information about the ghc-commits
mailing list