Changeset 223950 in webkit


Ignore:
Timestamp:
Oct 24, 2017 11:55:36 PM (6 years ago)
Author:
zandobersek@gmail.com
Message:

[Linux] Enable Gigacage in x64 Linux environment
https://bugs.webkit.org/show_bug.cgi?id=177745
<rdar://problem/34773148>

Reviewed by Yusuke Suzuki.

Re-enable Gigacage on x86_64 Linux platforms after it was disabled in 223877.

The cause for the revert was problems with huge coredumps being generated
while Gigacage was enabled. The feature virtually allocates about 80GB of
memory at the beginning of the process lifetime. This is not a problem in
itself since the memory range is marked as not needed through madvise(),
but all this memory was still included upon core dump generation on Linux.
Since there are reasonable limits enforced upon core dumps, these were
being truncated every time, not yielding any useful information.

To avoid this, on Linux, invocations of madvise() with the MADV_NORMAL and
MADV_DONTNEED advice parameters should be accompanied with respectively
matching MADV_DODUMP and MADV_DONTDUMP madvise() calls. This correctly
avoids core-dumping any memory that's not yet been physically allocated.

  • bmalloc/Gigacage.h:
  • bmalloc/VMAllocate.h:

(bmalloc::vmDeallocatePhysicalPages):
(bmalloc::vmAllocatePhysicalPages):

Location:
trunk/Source/bmalloc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/bmalloc/ChangeLog

    r223936 r223950  
     12017-10-24  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [Linux] Enable Gigacage in x64 Linux environment
     4        https://bugs.webkit.org/show_bug.cgi?id=177745
     5        <rdar://problem/34773148>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        Re-enable Gigacage on x86_64 Linux platforms after it was disabled in 223877.
     10
     11        The cause for the revert was problems with huge coredumps being generated
     12        while Gigacage was enabled. The feature virtually allocates about 80GB of
     13        memory at the beginning of the process lifetime. This is not a problem in
     14        itself since the memory range is marked as not needed through madvise(),
     15        but all this memory was still included upon core dump generation on Linux.
     16        Since there are reasonable limits enforced upon core dumps, these were
     17        being truncated every time, not yielding any useful information.
     18
     19        To avoid this, on Linux, invocations of madvise() with the MADV_NORMAL and
     20        MADV_DONTNEED advice parameters should be accompanied with respectively
     21        matching MADV_DODUMP and MADV_DONTDUMP madvise() calls. This correctly
     22        avoids core-dumping any memory that's not yet been physically allocated.
     23
     24        * bmalloc/Gigacage.h:
     25        * bmalloc/VMAllocate.h:
     26        (bmalloc::vmDeallocatePhysicalPages):
     27        (bmalloc::vmAllocatePhysicalPages):
     28
    1292017-10-24  David Kilzer  <ddkilzer@apple.com>
    230
  • trunk/Source/bmalloc/bmalloc/Gigacage.h

    r223877 r223950  
    5353#define STRING_GIGACAGE_MASK GIGACAGE_SIZE_TO_MASK(STRING_GIGACAGE_SIZE)
    5454
    55 #if (BOS(DARWIN) && (BCPU(ARM64) || BCPU(X86_64)))
     55#if (BOS(DARWIN) && (BCPU(ARM64) || BCPU(X86_64))) || (BOS(LINUX) && BCPU(X86_64))
    5656#define GIGACAGE_ENABLED 1
    5757#else
  • trunk/Source/bmalloc/bmalloc/VMAllocate.h

    r223936 r223950  
    194194#else
    195195    SYSCALL(madvise(p, vmSize, MADV_DONTNEED));
     196#if BOS(LINUX)
     197    SYSCALL(madvise(p, vmSize, MADV_DONTDUMP));
     198#endif
    196199#endif
    197200}
     
    204207#else
    205208    SYSCALL(madvise(p, vmSize, MADV_NORMAL));
     209#if BOS(LINUX)
     210    SYSCALL(madvise(p, vmSize, MADV_DODUMP));
     211#endif
    206212#endif
    207213}
Note: See TracChangeset for help on using the changeset viewer.