Changeset 179942 in webkit


Ignore:
Timestamp:
Feb 11, 2015 12:09:13 PM (9 years ago)
Author:
ChangSeok Oh
Message:

Activate ReliefLogger of a memory pressure handler for linux system.
https://bugs.webkit.org/show_bug.cgi?id=123611

Reviewed by Anders Carlsson.

Source/WebCore:

Put more logs for the time when a system goes under memory pressure or viceversa.

No new tests since no engine behavior changed.

  • platform/linux/MemoryPressureHandlerLinux.cpp:

(WebCore::MemoryPressureHandler::waitForMemoryPressureEvent): Wait a memory pressure event
from cgroup in a seperated thread. Once a pressure event happens, respondToMemoryPressure()
would be called to get back some resources.
(WebCore::MemoryPressureHandler::install): Install memoryPressureHandler module
to make it work.

Source/WebKit2:

  • Shared/WebProcessCreationParameters.cpp:

(WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
Make the parameter, shouldEnableMemoryPressureReliefLogging shareable with COCOA else systems.
(WebKit::WebProcessCreationParameters::encode): ditto.
(WebKit::WebProcessCreationParameters::decode): ditto.

  • Shared/WebProcessCreationParameters.h:
  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::createNewWebProcess): Set shouldEnableMemoryPressureReliefLogging
to true for linux system.

  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::initializeWebProcess): Pass the shouldEnableMemoryPressureReliefLogging value
to MemoryPressureHandler::ReliefLogger::setLoggingEnabled().

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r179941 r179942  
     12015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
     2
     3        Activate ReliefLogger of a memory pressure handler for linux system.
     4        https://bugs.webkit.org/show_bug.cgi?id=123611
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Put more logs for the time when a system goes under memory pressure or viceversa.
     9
     10        No new tests since no engine behavior changed.
     11
     12        * platform/linux/MemoryPressureHandlerLinux.cpp:
     13        (WebCore::MemoryPressureHandler::waitForMemoryPressureEvent): Wait a memory pressure event
     14        from cgroup in a seperated thread. Once a pressure event happens, respondToMemoryPressure()
     15        would be called to get back some resources.
     16        (WebCore::MemoryPressureHandler::install): Install memoryPressureHandler module
     17        to make it work.
     18
    1192015-02-11  Alex Christensen  <achristensen@webkit.org>
    220
  • trunk/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp

    r178667 r179942  
    9898    }
    9999
    100     memoryPressureHandler().m_underMemoryPressure = true;
    101     callOnMainThread([] {
    102         memoryPressureHandler().respondToMemoryPressure(true);
     100    // FIXME: Current memcg does not provide any way for users to know how serious the memory pressure is.
     101    // So we assume all notifications from memcg are critical for now. If memcg had better inferfaces
     102    // to get a detailed memory pressure level in the future, we should update here accordingly.
     103    bool critical = true;
     104    if (ReliefLogger::loggingEnabled())
     105        LOG(MemoryPressure, "Got memory pressure notification (%s)", critical ? "critical" : "non-critical");
     106
     107    memoryPressureHandler().setUnderMemoryPressure(critical);
     108    callOnMainThread([critical] {
     109        memoryPressureHandler().respondToMemoryPressure(critical);
    103110    });
    104111}
     
    157164    }
    158165
    159     m_underMemoryPressure = false;
     166    if (ReliefLogger::loggingEnabled() && isUnderMemoryPressure())
     167        LOG(MemoryPressure, "System is no longer under memory pressure.");
     168
     169    setUnderMemoryPressure(false);
    160170    m_installed = true;
    161171}
  • trunk/Source/WebKit2/ChangeLog

    r179932 r179942  
     12015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
     2
     3        Activate ReliefLogger of a memory pressure handler for linux system.
     4        https://bugs.webkit.org/show_bug.cgi?id=123611
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * Shared/WebProcessCreationParameters.cpp:
     9        (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
     10        Make the parameter, shouldEnableMemoryPressureReliefLogging shareable with COCOA else systems.
     11        (WebKit::WebProcessCreationParameters::encode): ditto.
     12        (WebKit::WebProcessCreationParameters::decode): ditto.
     13        * Shared/WebProcessCreationParameters.h:
     14        * UIProcess/WebProcessPool.cpp:
     15        (WebKit::WebProcessPool::createNewWebProcess): Set shouldEnableMemoryPressureReliefLogging
     16        to true for linux system.
     17        * WebProcess/WebProcess.cpp:
     18        (WebKit::WebProcess::initializeWebProcess): Pass the shouldEnableMemoryPressureReliefLogging value
     19        to MemoryPressureHandler::ReliefLogger::setLoggingEnabled().
     20
    1212015-02-11  Yusuke Suzuki  <utatane.tea@gmail.com>
    222
  • trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp

    r179870 r179942  
    3434WebProcessCreationParameters::WebProcessCreationParameters()
    3535    : shouldAlwaysUseComplexTextCodePath(false)
     36    , shouldEnableMemoryPressureReliefLogging(false)
    3637    , shouldUseFontSmoothing(true)
    3738    , defaultRequestTimeoutInterval(INT_MAX)
     
    4243    , shouldEnableJIT(false)
    4344    , shouldEnableFTLJIT(false)
    44     , shouldEnableMemoryPressureReliefLogging(false)
    4545#endif
    4646#if ENABLE(NETWORK_PROCESS)
     
    101101    encoder.encodeEnum(cacheModel);
    102102    encoder << shouldAlwaysUseComplexTextCodePath;
     103    encoder << shouldEnableMemoryPressureReliefLogging;
    103104    encoder << shouldUseFontSmoothing;
    104105    encoder << iconDatabaseEnabled;
     
    122123    encoder << shouldEnableJIT;
    123124    encoder << shouldEnableFTLJIT;
    124     encoder << shouldEnableMemoryPressureReliefLogging;
    125125    encoder << !!bundleParameterData;
    126126    if (bundleParameterData)
     
    221221    if (!decoder.decode(parameters.shouldAlwaysUseComplexTextCodePath))
    222222        return false;
     223    if (!decoder.decode(parameters.shouldEnableMemoryPressureReliefLogging))
     224        return false;
    223225    if (!decoder.decode(parameters.shouldUseFontSmoothing))
    224226        return false;
     
    261263    if (!decoder.decode(parameters.shouldEnableFTLJIT))
    262264        return false;
    263     if (!decoder.decode(parameters.shouldEnableMemoryPressureReliefLogging))
    264         return false;
    265    
     265
    266266    bool hasBundleParameterData;
    267267    if (!decoder.decode(hasBundleParameterData))
  • trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h

    r179870 r179942  
    110110
    111111    bool shouldAlwaysUseComplexTextCodePath;
     112    bool shouldEnableMemoryPressureReliefLogging;
    112113    bool shouldUseFontSmoothing;
    113114
     
    144145    bool shouldEnableJIT;
    145146    bool shouldEnableFTLJIT;
    146     bool shouldEnableMemoryPressureReliefLogging;
    147147   
    148148    RefPtr<API::Data> bundleParameterData;
  • trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp

    r179870 r179942  
    685685#endif
    686686
     687#if OS(LINUX)
     688    parameters.shouldEnableMemoryPressureReliefLogging = true;
     689#endif
     690
    687691    // Add any platform specific parameters
    688692    platformInitializeWebProcess(parameters);
  • trunk/Source/WebKit2/WebProcess/WebProcess.cpp

    r179870 r179942  
    277277#endif
    278278
     279#if OS(LINUX)
     280    WebCore::MemoryPressureHandler::ReliefLogger::setLoggingEnabled(parameters.shouldEnableMemoryPressureReliefLogging);
     281#endif
     282
    279283    platformInitializeWebProcess(WTF::move(parameters));
    280284
Note: See TracChangeset for help on using the changeset viewer.