[Git][ghc/ghc][wip/andreask/large_address_space] Enable large address space optimization on windows.

Andreas Klebinger gitlab at gitlab.haskell.org
Mon Apr 6 18:05:12 UTC 2020



Andreas Klebinger pushed to branch wip/andreask/large_address_space at Glasgow Haskell Compiler / GHC


Commits:
3be40803 by Andreas Klebinger at 2020-04-06T20:04:55+02:00
Enable large address space optimization on windows.

Starting with Win 8.1/Server 2012 windows no longer preallocates
page tables for reserverd memory eagerly, which prevented us from
using this approach in the past.

- - - - -


2 changed files:

- configure.ac
- docs/users_guide/8.12.1-notes.rst


Changes:

=====================================
configure.ac
=====================================
@@ -1203,11 +1203,15 @@ if test "$ac_cv_sizeof_void_p" -eq 8 ; then
     if test "x$EnableLargeAddressSpace" = "xyes" ; then
         if test "$ghc_host_os" = "darwin" ; then
             use_large_address_space=yes
-	elif test "$ghc_host_os" = "openbsd" ; then
-	    # as of OpenBSD 5.8 (2015), OpenBSD does not support mmap with MAP_NORESERVE.
-	    # The flag MAP_NORESERVE is supported for source compatibility reasons,
-	    # but is completely ignored by OS mmap
-            use_large_address_space=no
+        elif test "$ghc_host_os" = "openbsd" ; then
+            # as of OpenBSD 5.8 (2015), OpenBSD does not support mmap with MAP_NORESERVE.
+            # The flag MAP_NORESERVE is supported for source compatibility reasons,
+            # but is completely ignored by OS mmap
+                  use_large_address_space=no
+        elif test "$ghc_host_os" = "mingw32" ; then
+            # as of Windows 8.1/Server 2012 windows does no longer allocate the page
+            # tabe for reserved memory eagerly. So we are now free to use LAS there too.
+                  use_large_address_space=yes
         else
             AC_CHECK_DECLS([MAP_NORESERVE, MADV_FREE, MADV_DONTNEED],[],[],
                 [


=====================================
docs/users_guide/8.12.1-notes.rst
=====================================
@@ -40,7 +40,7 @@ Language
 
   There is a chance we will tweak the lookup scheme in the future, to make this
   workaround unnecessary.
-  
+
 Compiler
 ~~~~~~~~
 
@@ -52,6 +52,12 @@ GHCi
 Runtime system
 ~~~~~~~~~~~~~~
 
+ - Windows now uses the large address space allocator by default.
+   In extreme cases we saw improvements by up to 3% decreased runtime.
+
+   The downside is that haskell apps run on older (Pre Win-8.1/Server 2012)
+   systems will have higher memory footprints.
+
 Template Haskell
 ~~~~~~~~~~~~~~~~
 



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3be4080346729d966b10160100b4025b7bb6bd8b
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/20200406/40cd66a6/attachment-0001.html>


More information about the ghc-commits mailing list