REGRESSION(r137994): It made JSC tests hang and layout tests fail on ARM Thumb2 ...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Feb 2013 12:09:18 +0000 (12:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Feb 2013 12:09:18 +0000 (12:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=108632

Patch by Simon Hausmann <simon.hausmann@digia.com> on 2013-02-27
Reviewed by Csaba Osztrogon√°c.

It appears that mprotect() is very slow on ARM/Linux, so disable the
approach of unreserved mappings there and fall back to overcomitting
memory, based on Uli Schlachter's recommendation.

* wtf/OSAllocatorPosix.cpp:
(WTF::OSAllocator::reserveUncommitted):
(WTF::OSAllocator::decommit):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144170 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/OSAllocatorPosix.cpp

index f1b55f1..8c2f8ee 100644 (file)
@@ -1,3 +1,18 @@
+2013-02-27  Simon Hausmann  <simon.hausmann@digia.com>
+
+        REGRESSION(r137994): It made JSC tests hang and layout tests fail on ARM Thumb2 / Linux
+        https://bugs.webkit.org/show_bug.cgi?id=108632
+
+        Reviewed by Csaba Osztrogon√°c.
+
+        It appears that mprotect() is very slow on ARM/Linux, so disable the
+        approach of unreserved mappings there and fall back to overcomitting
+        memory, based on Uli Schlachter's recommendation.
+
+        * wtf/OSAllocatorPosix.cpp:
+        (WTF::OSAllocator::reserveUncommitted):
+        (WTF::OSAllocator::decommit):
+
 2013-02-26  Roger Fong  <roger_fong@apple.com>
 
         Unreviewed. Build fix for VS2010 solution, take 2.
index 7b2a55c..8715b81 100644 (file)
@@ -43,7 +43,7 @@ void* OSAllocator::reserveUncommitted(size_t bytes, Usage usage, bool writable,
     void* result = mmap(0, bytes, PROT_NONE, MAP_LAZY | MAP_PRIVATE | MAP_ANON, -1, 0);
     if (result == MAP_FAILED)
         CRASH();
-#elif OS(LINUX)
+#elif OS(LINUX) && !CPU(ARM)
     UNUSED_PARAM(usage);
     UNUSED_PARAM(writable);
     UNUSED_PARAM(executable);
@@ -165,7 +165,7 @@ void OSAllocator::decommit(void* address, size_t bytes)
 #if OS(QNX)
     // Use PROT_NONE and MAP_LAZY to decommit the pages.
     mmap(address, bytes, PROT_NONE, MAP_FIXED | MAP_LAZY | MAP_PRIVATE | MAP_ANON, -1, 0);
-#elif OS(LINUX)
+#elif OS(LINUX) && !CPU(ARM)
     madvise(address, bytes, MADV_DONTNEED);
     if (mprotect(address, bytes, PROT_NONE))
         CRASH();