⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 249121 in webkit


Ignore:
Timestamp:
Aug 26, 2019, 3:31:59 PM (7 years ago)
Author:
ysuzuki@apple.com
Message:

[bmalloc] Disable IsoHeap completely if DebugHeap is enabled
https://bugs.webkit.org/show_bug.cgi?id=201154

Reviewed by Simon Fraser.

Previously we had the guarantee that IsoHeap is disabled when DebugHeap is enabled.
But this is guaranteed in a bit tricky way: when DebugHeap is enabled, Gigacage is disabled.
And IsoHeap is disabled when Gigacage is disabled. However r249065 enabled IsoHeap even if
Gigacage is disabled. This accidentally enabled IsoHeap even if DebugHeap is enabled.

Currently, this is incorrect. When DebugHeap is enabled, we do not start bmalloc::Scavenger.
So IsoHeap does not work. In addition, when DebugHeap is enabled, we want to investigate the Malloc data.
However IsoHeap wipes these information for IsoHeaped objects. Moreover enabling IsoHeap is not free
in terms of memory usage: bmalloc::Scavenger starts working.

So we should not enable IsoHeap in such an accidental way for DebugHeap environment. If we consider enabling
IsoHeap even if Malloc=1 is specified, we should first examine how memory is used by this change because
the users of Malloc=1 requires explicitly tight memory usage.

In this patch, we remove the accidental enabling of IsoHeap for DebugHeap by checking DebugHeap status in IsoTLS.

  • bmalloc/IsoTLS.cpp:

(bmalloc::IsoTLS::determineMallocFallbackState):

Location:
trunk/Source/bmalloc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/bmalloc/ChangeLog

    r249065 r249121  
     12019-08-26  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [bmalloc] Disable IsoHeap completely if DebugHeap is enabled
     4        https://bugs.webkit.org/show_bug.cgi?id=201154
     5
     6        Reviewed by Simon Fraser.
     7
     8        Previously we had the guarantee that IsoHeap is disabled when DebugHeap is enabled.
     9        But this is guaranteed in a bit tricky way: when DebugHeap is enabled, Gigacage is disabled.
     10        And IsoHeap is disabled when Gigacage is disabled. However r249065 enabled IsoHeap even if
     11        Gigacage is disabled. This accidentally enabled IsoHeap even if DebugHeap is enabled.
     12
     13        Currently, this is incorrect. When DebugHeap is enabled, we do not start bmalloc::Scavenger.
     14        So IsoHeap does not work. In addition, when DebugHeap is enabled, we want to investigate the Malloc data.
     15        However IsoHeap wipes these information for IsoHeaped objects. Moreover enabling IsoHeap is not free
     16        in terms of memory usage: bmalloc::Scavenger starts working.
     17
     18        So we should not enable IsoHeap in such an accidental way for DebugHeap environment. If we consider enabling
     19        IsoHeap even if `Malloc=1` is specified, we should first examine how memory is used by this change because
     20        the users of `Malloc=1` requires explicitly tight memory usage.
     21
     22        In this patch, we remove the accidental enabling of IsoHeap for DebugHeap by checking DebugHeap status in IsoTLS.
     23
     24        * bmalloc/IsoTLS.cpp:
     25        (bmalloc::IsoTLS::determineMallocFallbackState):
     26
    1272019-08-22  Mark Lam  <mark.lam@apple.com>
    228
  • trunk/Source/bmalloc/bmalloc/IsoTLS.cpp

    r249065 r249121  
    184184                return;
    185185
     186            if (Environment::get()->isDebugHeapEnabled()) {
     187                s_mallocFallbackState = MallocFallbackState::FallBackToMalloc;
     188                return;
     189            }
     190
    186191            const char* env = getenv("bmalloc_IsoHeap");
    187192            if (env && (!strcasecmp(env, "false") || !strcasecmp(env, "no") || !strcmp(env, "0")))
Note: See TracChangeset for help on using the changeset viewer.