[Git][ghc/ghc][wip/hugepages] Apply 4 suggestion(s) to 3 file(s)

Teo Camarasu (@teo) gitlab at gitlab.haskell.org
Tue May 21 10:01:36 UTC 2024



Teo Camarasu pushed to branch wip/hugepages at Glasgow Haskell Compiler / GHC


Commits:
3e973d10 by Cheng Shao at 2024-05-21T10:01:32+00:00
Apply 4 suggestion(s) to 3 file(s)
- - - - -


3 changed files:

- rts/RtsFlags.c
- rts/posix/OSMem.c
- rts/sm/OSMem.h


Changes:

=====================================
rts/RtsFlags.c
=====================================
@@ -1845,7 +1845,7 @@ error = true;
                     break;
 
                 case 'H':
-                    OPTION_SAFE;
+                    OPTION_UNSAFE;
                     RtsFlags.GcFlags.hugepages = true;
                     break;
 


=====================================
rts/posix/OSMem.c
=====================================
@@ -74,8 +74,8 @@
 # endif
 #endif
 
-int huge_tried = 0;
-int huge_failed = 0;
+static int huge_tried = 0;
+static int huge_failed = 0;
 
 static void *next_request = 0;
 


=====================================
rts/sm/OSMem.h
=====================================
@@ -16,9 +16,9 @@
 #define HUGEPAGE_SHIFT 21
 #define HUGEPAGE_FLAGS (MAP_HUGETLB | MAP_HUGE_2MB)
 #else
-#define HUGEPAGE_SHIFT 20
+#define HUGEPAGE_SHIFT MBLOCK_SHIFT
 #endif
-
+GHC_STATIC_ASSERT(HUGEPAGE_SHIFT >= MBLOCK_SHIFT, "mblock size must not exceed 2MB huge page size");
 #define HUGEPAGE_SIZE (1 << HUGEPAGE_SHIFT)
 #define HUGEPAGE_MASK ((1 << HUGEPAGE_SHIFT) - 1)
 #define MBLOCK_ROUND_DOWN_HUGEPAGE(x) ((x) & ~(HUGEPAGE_SHIFT - MBLOCK_SHIFT))



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3e973d10e3956565232f4a9528de36a4f7ce64b3

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3e973d10e3956565232f4a9528de36a4f7ce64b3
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/20240521/1711eb1b/attachment-0001.html>


More information about the ghc-commits mailing list