RTS: Reduce MBLOCK_SPACE_SIZE on AArch64
authorErik de Castro Lopo <erikd@mega-nerd.com>
Tue, 25 Aug 2015 02:07:45 +0000 (02:07 +0000)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Fri, 28 Aug 2015 16:50:54 +0000 (02:50 +1000)
Commit 0d1a8d09f4 added a two step allocator for 64 bit systems. This
allocator mmaps a huge (1 TB) chunk of memory out of which it does
smaller allocations. On AArch64/Arm64 linux, this mmap was failing
due to the Arm64 Linux kernel parameter CONFIG_ARM64_VA_BITS
defaulting to 39 bits.

Therefore reducing the AArch64 value for MBLOCK_SPACE_SIZE to make
this allocation 1/4 TB while remaining 1 TB for other archs.

Reviewers: ezyang, austin, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1171

GHC Trac Issues: #10682

rts/sm/HeapAlloc.h

index c914b5d..f2760bd 100644 (file)
 #ifdef USE_LARGE_ADDRESS_SPACE
 
 extern W_ mblock_address_space_begin;
+#if aarch64_HOST_ARCH
+# define MBLOCK_SPACE_SIZE      ((StgWord)1 << 38) /* 1/4 TB */
+#else
 # define MBLOCK_SPACE_SIZE      ((StgWord)1 << 40) /* 1 TB */
+#endif
+
 # define HEAP_ALLOCED(p)        ((W_)(p) >= mblock_address_space_begin && \
                                  (W_)(p) < (mblock_address_space_begin +  \
                                             MBLOCK_SPACE_SIZE))