WebKit Bugzilla
Attachment 341092 Details for
Bug 184261
: [GTK][WPE] Memory pressure monitor doesn't reliable notify all the subprocesses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-184261-20180523164600.patch (text/plain), 41.72 KB, created by
Carlos Alberto Lopez Perez
on 2018-05-23 07:46:02 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Alberto Lopez Perez
Created:
2018-05-23 07:46:02 PDT
Size:
41.72 KB
patch
obsolete
>Subversion Revision: 232107 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 1c667d0a4ce9964a40d15eeddb71d1b1324a5498..97895ec11327f9d04141f62b5eb5f919ef3754e0 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,18 @@ >+2018-05-23 Carlos Alberto Lopez Perez <clopez@igalia.com> >+ >+ [GTK][WPE] Memory pressure monitor doesn't reliable notify all the subprocesses >+ https://bugs.webkit.org/show_bug.cgi?id=184261 >+ >+ Reviewed by Carlos Garcia Campos. >+ >+ Receive the memory pressure notifications from the UIProcess memory monitor via WebKit IPC. >+ >+ * wtf/MemoryPressureHandler.h: >+ * wtf/linux/MemoryPressureHandlerLinux.cpp: >+ (WTF::MemoryPressureHandler::triggerMemoryPressureEvent): >+ (WTF::MemoryPressureHandler::install): >+ (WTF::MemoryPressureHandler::uninstall): >+ > 2018-05-22 Mark Lam <mark.lam@apple.com> > > StringImpl utf8 conversion should not fail silently. >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 4f80874994253e0bcee7febe94e2719785015ad9..b3db3cf48c09815d2f34bbebcab7e3749c1a3c70 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,81 @@ >+2018-05-23 Carlos Alberto Lopez Perez <clopez@igalia.com> >+ >+ [GTK][WPE] Memory pressure monitor doesn't reliable notify all the subprocesses >+ https://bugs.webkit.org/show_bug.cgi?id=184261 >+ >+ Reviewed by Carlos Garcia Campos. >+ >+ On Linux we had two implementations for getting notifications about memory pressure events: >+ - The memory cgroup (called systemd here). >+ - The UIProcess memory monitor (which delivered events via a shared eventfd) >+ >+ The problem with the first is that it was usually not working on a standard machine due to >+ the special permissions or configurations required for memory cgroups, so the second one >+ (eventfd) was used as a fall-back in that case. >+ But this eventfd method is racy with more than one WebKit child process and it wasn't >+ reliably delivering the notifications. >+ >+ This patch removes the memory cgroup implementation and modifies the UIProcess memory monitor >+ to deliver the events via WebKit IPC. This simplifies the code a lot and allows us to have >+ only one implementation that should work in any Linux machine. >+ >+ The implementation now also triggers the event with information about the criticalness of it. >+ >+ Previously a critical event was triggered always at a 95% of pressure. >+ Now a non-critical one is triggered at 90% and critical remains at a 95%. >+ >+ Start triggering events early should compensate the fact than triggering the event via WebKit IPC is >+ a bit slower than doing that via an eventfd (or than listening on the memory cgroup event controller). >+ >+ The events are delivered to all WebKit childs: WebProcess, NetworkProcess, StorageProcess, PluginProcess. >+ >+ In the case of the StorageProcess a dummy controller is installed, which currently does nothing, >+ but leaves a note for a future implementation and at least allows to trigger platformReleaseMemory() >+ that on Linux/glibc should end calling malloc_trim() >+ >+ * NetworkProcess/NetworkProcess.cpp: >+ (WebKit::NetworkProcess::initializeNetworkProcess): >+ * NetworkProcess/NetworkProcessCreationParameters.cpp: >+ (WebKit::NetworkProcessCreationParameters::encode const): >+ (WebKit::NetworkProcessCreationParameters::decode): >+ * NetworkProcess/NetworkProcessCreationParameters.h: >+ * PluginProcess/PluginProcess.cpp: >+ (WebKit::PluginProcess::didReceiveMessage): >+ (WebKit::PluginProcess::initializePluginProcess): >+ * Shared/ChildProcess.cpp: >+ (WebKit::ChildProcess::didReceiveMemoryPressureEvent): >+ * Shared/ChildProcess.h: >+ * Shared/ChildProcess.messages.in: >+ * Shared/Plugins/PluginProcessCreationParameters.cpp: >+ (WebKit::PluginProcessCreationParameters::encode const): >+ (WebKit::PluginProcessCreationParameters::decode): >+ * Shared/Plugins/PluginProcessCreationParameters.h: >+ * Shared/WebProcessCreationParameters.cpp: >+ (WebKit::WebProcessCreationParameters::encode const): >+ (WebKit::WebProcessCreationParameters::decode): >+ * Shared/WebProcessCreationParameters.h: >+ * StorageProcess/StorageProcess.cpp: >+ (WebKit::StorageProcess::initializeProcess): >+ * UIProcess/Plugins/PluginProcessManager.cpp: >+ (WebKit::PluginProcessManager::sendMemoryPressureEvent): >+ * UIProcess/Plugins/PluginProcessManager.h: >+ * UIProcess/Plugins/PluginProcessProxy.cpp: >+ (WebKit::PluginProcessProxy::sendMemoryPressureEvent): >+ (WebKit::PluginProcessProxy::didFinishLaunching): >+ * UIProcess/Plugins/PluginProcessProxy.h: >+ * UIProcess/WebProcessPool.cpp: >+ (WebKit::WebProcessPool::sendMemoryPressureEvent): >+ (WebKit::WebProcessPool::ensureNetworkProcess): >+ (WebKit::WebProcessPool::initializeNewWebProcess): >+ * UIProcess/WebProcessPool.h: >+ (WebKit::WebProcessPool::sendToStorageProcess): >+ * UIProcess/linux/MemoryPressureMonitor.cpp: >+ (WebKit::pollIntervalForUsedMemoryPercentage): Fix equation for calculating the interval percentage. >+ (WebKit::MemoryPressureMonitor::MemoryPressureMonitor): >+ * UIProcess/linux/MemoryPressureMonitor.h: >+ * WebProcess/WebProcess.cpp: >+ (WebKit::WebProcess::initializeWebProcess): >+ > 2018-05-22 Brent Fulgham <bfulgham@apple.com> > > Close access to "lsopen" for non-UI process >diff --git a/Source/WTF/wtf/MemoryPressureHandler.h b/Source/WTF/wtf/MemoryPressureHandler.h >index 5d26356f3422b4c0a91183b8d62316c141b9790f..0039d054b0dbf06e6c6731081fb51479133dd551 100644 >--- a/Source/WTF/wtf/MemoryPressureHandler.h >+++ b/Source/WTF/wtf/MemoryPressureHandler.h >@@ -69,6 +69,10 @@ public: > > WTF_EXPORT_PRIVATE void setShouldUsePeriodicMemoryMonitor(bool); > >+#if OS(LINUX) >+ WTF_EXPORT_PRIVATE void triggerMemoryPressureEvent(bool isCritical); >+#endif >+ > void setMemoryKillCallback(WTF::Function<void()>&& function) { m_memoryKillCallback = WTFMove(function); } > void setMemoryPressureStatusChangedCallback(WTF::Function<void(bool)>&& function) { m_memoryPressureStatusChangedCallback = WTFMove(function); } > void setDidExceedInactiveLimitWhileActiveCallback(WTF::Function<void()>&& function) { m_didExceedInactiveLimitWhileActiveCallback = WTFMove(function); } >@@ -88,10 +92,6 @@ public: > } > void setUnderMemoryPressure(bool); > >-#if OS(LINUX) >- void setMemoryPressureMonitorHandle(int fd); >-#endif >- > class ReliefLogger { > public: > explicit ReliefLogger(const char *log) >@@ -169,26 +169,6 @@ private: > void doesExceedInactiveLimitWhileActive(); > void doesNotExceedInactiveLimitWhileActive(); > >-#if OS(LINUX) >- class EventFDPoller { >- WTF_MAKE_NONCOPYABLE(EventFDPoller); WTF_MAKE_FAST_ALLOCATED; >- public: >- EventFDPoller(int fd, WTF::Function<void ()>&& notifyHandler); >- ~EventFDPoller(); >- >- private: >- void readAndNotify() const; >- >- std::optional<int> m_fd; >- WTF::Function<void ()> m_notifyHandler; >-#if USE(GLIB) >- GRefPtr<GSource> m_source; >-#else >- RefPtr<Thread> m_thread; >-#endif >- }; >-#endif >- > WebsamProcessState m_processState { WebsamProcessState::Inactive }; > > unsigned m_pageCount { 0 }; >@@ -213,13 +193,8 @@ private: > #endif > > #if OS(LINUX) >- std::optional<int> m_eventFD; >- std::optional<int> m_pressureLevelFD; >- std::unique_ptr<EventFDPoller> m_eventFDPoller; > RunLoop::Timer<MemoryPressureHandler> m_holdOffTimer; > void holdOffTimerFired(); >- void logErrorAndCloseFDs(const char* error); >- bool tryEnsureEventFD(); > #endif > }; > >diff --git a/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp b/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp >index 8e85f58caf49df9f52da7ba3db1ac05b32a40bde..14f49989abbff418ad7fb863cc62dca27b64336f 100644 >--- a/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp >+++ b/Source/WTF/wtf/linux/MemoryPressureHandlerLinux.cpp >@@ -1,6 +1,7 @@ > /* > * Copyright (C) 2011, 2012 Apple Inc. All Rights Reserved. > * Copyright (C) 2014 Raspberry Pi Foundation. All Rights Reserved. >+ * Copyright (C) 2018 Igalia S.L. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -29,23 +30,13 @@ > > #if OS(LINUX) > >-#include <errno.h> >-#include <fcntl.h> > #include <malloc.h> >-#include <sys/eventfd.h> >-#include <sys/stat.h> >-#include <sys/types.h> > #include <unistd.h> > #include <wtf/MainThread.h> > #include <wtf/MemoryFootprint.h> > #include <wtf/linux/CurrentProcessMemoryStatus.h> > #include <wtf/text/WTFString.h> > >-#if USE(GLIB) >-#include <glib-unix.h> >-#include <wtf/glib/RunLoopSourcePriority.h> >-#endif >- > #define LOG_CHANNEL_PREFIX Log > > namespace WTF { >@@ -63,160 +54,27 @@ static const Seconds s_maximumHoldOffTime { 30_s }; > static const size_t s_minimumBytesFreedToUseMinimumHoldOffTime = 1 * MB; > static const unsigned s_holdOffMultiplier = 20; > >-static const char* s_cgroupMemoryPressureLevel = "/sys/fs/cgroup/memory/memory.pressure_level"; >-static const char* s_cgroupEventControl = "/sys/fs/cgroup/memory/cgroup.event_control"; >- >-#if USE(GLIB) >-typedef struct { >- GSource source; >- gpointer fdTag; >- GIOCondition condition; >-} EventFDSource; >- >-static const unsigned eventFDSourceCondition = G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL; >- >-static GSourceFuncs eventFDSourceFunctions = { >- nullptr, // prepare >- nullptr, // check >- // dispatch >- [](GSource* source, GSourceFunc callback, gpointer userData) -> gboolean >- { >- EventFDSource* eventFDSource = reinterpret_cast<EventFDSource*>(source); >- unsigned events = g_source_query_unix_fd(source, eventFDSource->fdTag) & eventFDSourceCondition; >- if (events & G_IO_HUP || events & G_IO_ERR || events & G_IO_NVAL) >- return G_SOURCE_REMOVE; >- >- gboolean returnValue = G_SOURCE_CONTINUE; >- if (events & G_IO_IN) >- returnValue = callback(userData); >- g_source_set_ready_time(source, -1); >- return returnValue; >- }, >- nullptr, // finalize >- nullptr, // closure_callback >- nullptr, // closure_marshall >-}; >-#endif >- >-MemoryPressureHandler::EventFDPoller::EventFDPoller(int fd, WTF::Function<void ()>&& notifyHandler) >- : m_fd(fd) >- , m_notifyHandler(WTFMove(notifyHandler)) >+void MemoryPressureHandler::triggerMemoryPressureEvent(bool isCritical) > { >-#if USE(GLIB) >- m_source = adoptGRef(g_source_new(&eventFDSourceFunctions, sizeof(EventFDSource))); >- g_source_set_priority(m_source.get(), RunLoopSourcePriority::MemoryPressureHandlerTimer); >- g_source_set_name(m_source.get(), "WTF: MemoryPressureHandler"); >- if (!g_unix_set_fd_nonblocking(m_fd.value(), TRUE, nullptr)) { >- LOG(MemoryPressure, "Failed to set eventfd nonblocking"); >- return; >- } >- >- EventFDSource* eventFDSource = reinterpret_cast<EventFDSource*>(m_source.get()); >- eventFDSource->fdTag = g_source_add_unix_fd(m_source.get(), m_fd.value(), static_cast<GIOCondition>(eventFDSourceCondition)); >- g_source_set_callback(m_source.get(), [](gpointer userData) -> gboolean { >- static_cast<EventFDPoller*>(userData)->readAndNotify(); >- return G_SOURCE_REMOVE; >- }, this, nullptr); >- g_source_attach(m_source.get(), nullptr); >-#else >- m_thread = Thread::create("WTF: MemoryPressureHandler", >- [this] { >- readAndNotify(); >- }); >-#endif >-} >- >-MemoryPressureHandler::EventFDPoller::~EventFDPoller() >-{ >- m_fd = std::nullopt; >-#if USE(GLIB) >- g_source_destroy(m_source.get()); >-#else >- m_thread->detach(); >-#endif >-} >- >-static inline bool isFatalReadError(int error) >-{ >-#if USE(GLIB) >- // We don't really need to read the buffer contents, if the poller >- // notified us, but read would block or is no longer available, is >- // enough to trigger the memory pressure handler. >- return error != EAGAIN && error != EWOULDBLOCK; >-#else >- return true; >-#endif >-} >- >-void MemoryPressureHandler::EventFDPoller::readAndNotify() const >-{ >- if (!m_fd) { >- LOG(MemoryPressure, "Invalidate eventfd."); >+ if (!m_installed) > return; >- } > >- uint64_t buffer; >- if (read(m_fd.value(), &buffer, sizeof(buffer)) == -1) { >- if (isFatalReadError(errno)) { >- LOG(MemoryPressure, "Failed to read eventfd."); >- return; >- } >- } >+ if (ReliefLogger::loggingEnabled()) >+ LOG(MemoryPressure, "Got memory pressure notification (%s)", isCritical ? "critical" : "non-critical"); > >- m_notifyHandler(); >-} >+ setUnderMemoryPressure(true); > >-inline void MemoryPressureHandler::logErrorAndCloseFDs(const char* log) >-{ >- if (log) >- LOG(MemoryPressure, "%s, error : %m", log); >- >- if (m_eventFD) { >- close(m_eventFD.value()); >- m_eventFD = std::nullopt; >- } >- if (m_pressureLevelFD) { >- close(m_pressureLevelFD.value()); >- m_pressureLevelFD = std::nullopt; >- } >-} >- >-bool MemoryPressureHandler::tryEnsureEventFD() >-{ >- if (m_eventFD) >- return true; >- >- // Try to use cgroups instead. >- int fd = eventfd(0, EFD_CLOEXEC); >- if (fd == -1) { >- LOG(MemoryPressure, "eventfd() failed: %m"); >- return false; >- } >- m_eventFD = fd; >- >- fd = open(s_cgroupMemoryPressureLevel, O_CLOEXEC | O_RDONLY); >- if (fd == -1) { >- logErrorAndCloseFDs("Failed to open memory.pressure_level"); >- return false; >- } >- m_pressureLevelFD = fd; >- >- fd = open(s_cgroupEventControl, O_CLOEXEC | O_WRONLY); >- if (fd == -1) { >- logErrorAndCloseFDs("Failed to open cgroup.event_control"); >- return false; >- } >+ if (isMainThread()) >+ respondToMemoryPressure(isCritical ? Critical::Yes : Critical::No); >+ else >+ RunLoop::main().dispatch([this, isCritical] { >+ respondToMemoryPressure(isCritical ? Critical::Yes : Critical::No); >+ }); > >- char line[128] = {0, }; >- if (snprintf(line, sizeof(line), "%d %d low", m_eventFD.value(), m_pressureLevelFD.value()) < 0 >- || write(fd, line, strlen(line) + 1) < 0) { >- logErrorAndCloseFDs("Failed to write cgroup.event_control"); >- close(fd); >- return false; >- } >- close(fd); >+ if (ReliefLogger::loggingEnabled() && isUnderMemoryPressure()) >+ LOG(MemoryPressure, "System is no longer under memory pressure."); > >- return true; >+ setUnderMemoryPressure(false); > } > > void MemoryPressureHandler::install() >@@ -224,28 +82,6 @@ void MemoryPressureHandler::install() > if (m_installed || m_holdOffTimer.isActive()) > return; > >- if (!tryEnsureEventFD()) >- return; >- >- m_eventFDPoller = std::make_unique<EventFDPoller>(m_eventFD.value(), [this] { >- // FIXME: Current memcg does not provide any way for users to know how serious the memory pressure is. >- // So we assume all notifications from memcg are critical for now. If memcg had better inferfaces >- // to get a detailed memory pressure level in the future, we should update here accordingly. >- bool critical = true; >- if (ReliefLogger::loggingEnabled()) >- LOG(MemoryPressure, "Got memory pressure notification (%s)", critical ? "critical" : "non-critical"); >- >- setUnderMemoryPressure(critical); >- if (isMainThread()) >- respondToMemoryPressure(critical ? Critical::Yes : Critical::No); >- else >- RunLoop::main().dispatch([this, critical] { respondToMemoryPressure(critical ? Critical::Yes : Critical::No); }); >- }); >- >- if (ReliefLogger::loggingEnabled() && isUnderMemoryPressure()) >- LOG(MemoryPressure, "System is no longer under memory pressure."); >- >- setUnderMemoryPressure(false); > m_installed = true; > } > >@@ -255,18 +91,6 @@ void MemoryPressureHandler::uninstall() > return; > > m_holdOffTimer.stop(); >- m_eventFDPoller = nullptr; >- >- if (m_pressureLevelFD) { >- close(m_pressureLevelFD.value()); >- m_pressureLevelFD = std::nullopt; >- >- // Only close the eventFD used for cgroups. >- if (m_eventFD) { >- close(m_eventFD.value()); >- m_eventFD = std::nullopt; >- } >- } > > m_installed = false; > } >@@ -318,11 +142,6 @@ std::optional<MemoryPressureHandler::ReliefLogger::MemoryUsage> MemoryPressureHa > return MemoryUsage {processMemoryUsage(), physical}; > } > >-void MemoryPressureHandler::setMemoryPressureMonitorHandle(int fd) >-{ >- ASSERT(!m_eventFD); >- m_eventFD = fd; >-} > > } // namespace WTF > >diff --git a/Source/WebKit/NetworkProcess/NetworkProcess.cpp b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >index 7f0b5f8d46d0976b0e357340eb00a6cddcc46e4f..a4bc45e19d17d9ceac214f3e5d5b4ac08b93713c 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcess.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkProcess.cpp >@@ -232,10 +232,6 @@ void NetworkProcess::initializeNetworkProcess(NetworkProcessCreationParameters&& > m_loadThrottleLatency = parameters.loadThrottleLatency; > if (!m_suppressMemoryPressureHandler) { > auto& memoryPressureHandler = MemoryPressureHandler::singleton(); >-#if OS(LINUX) >- if (parameters.memoryPressureMonitorHandle.fileDescriptor() != -1) >- memoryPressureHandler.setMemoryPressureMonitorHandle(parameters.memoryPressureMonitorHandle.releaseFileDescriptor()); >-#endif > memoryPressureHandler.setLowMemoryHandler([this] (Critical critical, Synchronous) { > lowMemoryHandler(critical); > }); >diff --git a/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp b/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp >index d61cff8d00a474d7308ab38c4a8e633feafeefb5..f855293396efaba94a9fb01bad558314c7f7e238 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp >@@ -100,9 +100,6 @@ void NetworkProcessCreationParameters::encode(IPC::Encoder& encoder) const > #if HAVE(CFNETWORK_STORAGE_PARTITIONING) && !RELEASE_LOG_DISABLED > encoder << logCookieInformation; > #endif >-#if OS(LINUX) >- encoder << memoryPressureMonitorHandle; >-#endif > #if ENABLE(NETWORK_CAPTURE) > encoder << recordReplayMode; > encoder << recordReplayCacheLocation; >@@ -254,11 +251,6 @@ bool NetworkProcessCreationParameters::decode(IPC::Decoder& decoder, NetworkProc > return false; > #endif > >-#if OS(LINUX) >- if (!decoder.decode(result.memoryPressureMonitorHandle)) >- return false; >-#endif >- > #if ENABLE(NETWORK_CAPTURE) > if (!decoder.decode(result.recordReplayMode)) > return false; >diff --git a/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h b/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h >index 25bc08f55cf7a4f6e71e901fb002635b5d945944..5d0fe13a5e6a75d80eb79c5f4bbbdd6b2b617bea 100644 >--- a/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h >+++ b/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h >@@ -25,7 +25,6 @@ > > #pragma once > >-#include "Attachment.h" > #include "CacheModel.h" > #include "NetworkSessionCreationParameters.h" > #include "SandboxExtension.h" >@@ -116,10 +115,6 @@ struct NetworkProcessCreationParameters { > bool logCookieInformation { false }; > #endif > >-#if OS(LINUX) >- IPC::Attachment memoryPressureMonitorHandle; >-#endif >- > #if ENABLE(NETWORK_CAPTURE) > String recordReplayMode; > String recordReplayCacheLocation; >diff --git a/Source/WebKit/PluginProcess/PluginProcess.cpp b/Source/WebKit/PluginProcess/PluginProcess.cpp >index 1cd3075b6bc27aa8257b43635a670238d6b8c93c..a41e64c40ae8acf97d29ae998c13dcd82a004ddb 100644 >--- a/Source/WebKit/PluginProcess/PluginProcess.cpp >+++ b/Source/WebKit/PluginProcess/PluginProcess.cpp >@@ -30,6 +30,7 @@ > > #include "ArgumentCoders.h" > #include "Attachment.h" >+#include "ChildProcessMessages.h" > #include "NetscapePlugin.h" > #include "NetscapePluginModule.h" > #include "PluginProcessConnectionMessages.h" >@@ -116,6 +117,11 @@ bool PluginProcess::shouldTerminate() > > void PluginProcess::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder) > { >+ if (decoder.messageReceiverName() == Messages::ChildProcess::messageReceiverName()) { >+ ChildProcess::didReceiveMessage(connection, decoder); >+ return; >+ } >+ > didReceivePluginProcessMessage(connection, decoder); > } > >@@ -124,10 +130,6 @@ void PluginProcess::initializePluginProcess(PluginProcessCreationParameters&& pa > ASSERT(!m_pluginModule); > > auto& memoryPressureHandler = MemoryPressureHandler::singleton(); >-#if OS(LINUX) >- if (parameters.memoryPressureMonitorHandle.fileDescriptor() != -1) >- memoryPressureHandler.setMemoryPressureMonitorHandle(parameters.memoryPressureMonitorHandle.releaseFileDescriptor()); >-#endif > memoryPressureHandler.setLowMemoryHandler([this] (Critical, Synchronous) { > if (shouldTerminate()) > terminate(); >diff --git a/Source/WebKit/Shared/ChildProcess.cpp b/Source/WebKit/Shared/ChildProcess.cpp >index 0b2cab7976967ab698ab1f9f666283fecdbc9997..4534243835d0f0ced3bb839562bf59fd565e90bf 100644 >--- a/Source/WebKit/Shared/ChildProcess.cpp >+++ b/Source/WebKit/Shared/ChildProcess.cpp >@@ -35,6 +35,10 @@ > #include <unistd.h> > #endif > >+#if OS(LINUX) >+#include <wtf/MemoryPressureHandler.h> >+#endif >+ > using namespace WebCore; > > namespace WebKit { >@@ -215,6 +219,14 @@ void ChildProcess::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReferen > WTFLogAlways("Received invalid message: '%s::%s'", messageReceiverName.toString().data(), messageName.toString().data()); > CRASH(); > } >+ >+#if OS(LINUX) >+void ChildProcess::didReceiveMemoryPressureEvent(bool isCritical) >+{ >+ MemoryPressureHandler::singleton().triggerMemoryPressureEvent(isCritical); >+} > #endif > >+#endif // !PLATFORM(COCOA) >+ > } // namespace WebKit >diff --git a/Source/WebKit/Shared/ChildProcess.h b/Source/WebKit/Shared/ChildProcess.h >index bfd16ea45eb81fff60f6f23fec0657e37f9ab281..b35c9f2e3f3fa87e2dfbee1b0afc979b98a2f8f1 100644 >--- a/Source/WebKit/Shared/ChildProcess.h >+++ b/Source/WebKit/Shared/ChildProcess.h >@@ -107,6 +107,9 @@ protected: > void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; > > void registerURLSchemeServiceWorkersCanHandle(const String&) const; >+#if OS(LINUX) >+ void didReceiveMemoryPressureEvent(bool isCritical); >+#endif > > private: > // IPC::MessageSender >diff --git a/Source/WebKit/Shared/ChildProcess.messages.in b/Source/WebKit/Shared/ChildProcess.messages.in >index 1dd1b1a32726a5835217dda0690a16ef2fb353e7..18cbcd8501078a90fb372d0cd9df6fa5f25829bb 100644 >--- a/Source/WebKit/Shared/ChildProcess.messages.in >+++ b/Source/WebKit/Shared/ChildProcess.messages.in >@@ -24,4 +24,8 @@ messages -> ChildProcess { > ShutDown() > RegisterURLSchemeServiceWorkersCanHandle(String scheme) > SetProcessSuppressionEnabled(bool flag) >+ >+#if OS(LINUX) >+ void DidReceiveMemoryPressureEvent(bool isCritical) >+#endif > } >diff --git a/Source/WebKit/Shared/Plugins/PluginProcessCreationParameters.cpp b/Source/WebKit/Shared/Plugins/PluginProcessCreationParameters.cpp >index 7bd78b6c3305525768d328c2f10c92912c3f2272..5e44035a3eab8220b5f1aecb0ac59633ce8efdb0 100644 >--- a/Source/WebKit/Shared/Plugins/PluginProcessCreationParameters.cpp >+++ b/Source/WebKit/Shared/Plugins/PluginProcessCreationParameters.cpp >@@ -49,9 +49,6 @@ void PluginProcessCreationParameters::encode(IPC::Encoder& encoder) const > encoder << acceleratedCompositingPort; > IPC::encode(encoder, networkATSContext.get()); > #endif >-#if OS(LINUX) >- encoder << memoryPressureMonitorHandle; >-#endif > } > > bool PluginProcessCreationParameters::decode(IPC::Decoder& decoder, PluginProcessCreationParameters& result) >@@ -70,10 +67,6 @@ bool PluginProcessCreationParameters::decode(IPC::Decoder& decoder, PluginProces > if (!IPC::decode(decoder, result.networkATSContext)) > return false; > #endif >-#if OS(LINUX) >- if (!decoder.decode(result.memoryPressureMonitorHandle)) >- return false; >-#endif > > return true; > } >diff --git a/Source/WebKit/Shared/Plugins/PluginProcessCreationParameters.h b/Source/WebKit/Shared/Plugins/PluginProcessCreationParameters.h >index 186cb3b9889fb8d81d126bc0aecf8a310646e4c5..d326880a9477b3abeb3ab3960aad0bac12a53a8f 100644 >--- a/Source/WebKit/Shared/Plugins/PluginProcessCreationParameters.h >+++ b/Source/WebKit/Shared/Plugins/PluginProcessCreationParameters.h >@@ -27,7 +27,6 @@ > > #if ENABLE(NETSCAPE_PLUGIN_API) > >-#include "Attachment.h" > #include "PluginProcessAttributes.h" > #include <wtf/Seconds.h> > >@@ -58,9 +57,6 @@ struct PluginProcessCreationParameters { > WTF::MachSendRight acceleratedCompositingPort; > RetainPtr<CFDataRef> networkATSContext; > #endif >-#if OS(LINUX) >- IPC::Attachment memoryPressureMonitorHandle; >-#endif > }; > > } // namespace WebKit >diff --git a/Source/WebKit/Shared/WebProcessCreationParameters.cpp b/Source/WebKit/Shared/WebProcessCreationParameters.cpp >index 9a1659706ee6ee0b3a6166417f60ff89774017aa..33a261d160bc72c9177dbdb6927788cdfa5d2b79 100644 >--- a/Source/WebKit/Shared/WebProcessCreationParameters.cpp >+++ b/Source/WebKit/Shared/WebProcessCreationParameters.cpp >@@ -139,10 +139,6 @@ void WebProcessCreationParameters::encode(IPC::Encoder& encoder) const > IPC::encode(encoder, networkATSContext.get()); > #endif > >-#if OS(LINUX) >- encoder << memoryPressureMonitorHandle; >-#endif >- > #if PLATFORM(WAYLAND) > encoder << waylandCompositorDisplayName; > #endif >@@ -381,11 +377,6 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat > return false; > #endif > >-#if OS(LINUX) >- if (!decoder.decode(parameters.memoryPressureMonitorHandle)) >- return false; >-#endif >- > #if PLATFORM(WAYLAND) > if (!decoder.decode(parameters.waylandCompositorDisplayName)) > return false; >diff --git a/Source/WebKit/Shared/WebProcessCreationParameters.h b/Source/WebKit/Shared/WebProcessCreationParameters.h >index 81d347e2f207aaf9ef5e558546d1f71f55a7c80c..3be0168286c7d8ff2625407847badae8cf64cc37 100644 >--- a/Source/WebKit/Shared/WebProcessCreationParameters.h >+++ b/Source/WebKit/Shared/WebProcessCreationParameters.h >@@ -173,10 +173,6 @@ struct WebProcessCreationParameters { > RetainPtr<CFDataRef> networkATSContext; > #endif > >-#if OS(LINUX) >- IPC::Attachment memoryPressureMonitorHandle; >-#endif >- > #if PLATFORM(WAYLAND) > String waylandCompositorDisplayName; > #endif >diff --git a/Source/WebKit/StorageProcess/StorageProcess.cpp b/Source/WebKit/StorageProcess/StorageProcess.cpp >index 6a98d1ad8d910b8ba40368a88b0a2eba696ce609..5782a2ae64ee59db9e1cabce335d04b29a3b4219 100644 >--- a/Source/WebKit/StorageProcess/StorageProcess.cpp >+++ b/Source/WebKit/StorageProcess/StorageProcess.cpp >@@ -49,6 +49,8 @@ > #include <wtf/CallbackAggregator.h> > #include <wtf/CrossThreadTask.h> > #include <wtf/MainThread.h> >+#include <wtf/MemoryPressureHandler.h> >+ > > #if ENABLE(SERVICE_WORKER) > #include "WebSWServerToContextConnectionMessages.h" >@@ -555,6 +557,14 @@ void StorageProcess::disableServiceWorkerProcessTerminationDelay() > #if !PLATFORM(COCOA) > void StorageProcess::initializeProcess(const ChildProcessInitializationParameters&) > { >+#if OS(LINUX) >+ auto& memoryPressureHandler = MemoryPressureHandler::singleton(); >+ memoryPressureHandler.setLowMemoryHandler([this] (Critical, Synchronous) { >+ // FIXME: no lowMemoryHandler() implemented for StorageProcess currently. >+ // But at least define this setLowMemoryHandler() empty so platformReleaseMemory is called. >+ }); >+ memoryPressureHandler.install(); >+#endif > } > > void StorageProcess::initializeProcessName(const ChildProcessInitializationParameters&) >@@ -564,6 +574,6 @@ void StorageProcess::initializeProcessName(const ChildProcessInitializationParam > void StorageProcess::initializeSandbox(const ChildProcessInitializationParameters&, SandboxInitializationParameters&) > { > } >-#endif >+#endif // !PLATFORM(COCOA) > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/Plugins/PluginProcessManager.cpp b/Source/WebKit/UIProcess/Plugins/PluginProcessManager.cpp >index 139fa5ac953b9cc0eca49f44a93d6349163b4cb1..ad810af0a783810856acd1a4d5e5a1c30cfce7fb 100644 >--- a/Source/WebKit/UIProcess/Plugins/PluginProcessManager.cpp >+++ b/Source/WebKit/UIProcess/Plugins/PluginProcessManager.cpp >@@ -131,6 +131,14 @@ PluginProcessProxy* PluginProcessManager::getPluginProcess(uint64_t pluginProces > return nullptr; > } > >+#if OS(LINUX) >+void PluginProcessManager::sendMemoryPressureEvent(bool isCritical) >+{ >+ for (auto pluginProcess : m_pluginProcesses) >+ pluginProcess->sendMemoryPressureEvent(isCritical); >+} >+#endif >+ > PluginProcessProxy* PluginProcessManager::getOrCreatePluginProcess(uint64_t pluginProcessToken) > { > if (auto existingProcess = getPluginProcess(pluginProcessToken)) >diff --git a/Source/WebKit/UIProcess/Plugins/PluginProcessManager.h b/Source/WebKit/UIProcess/Plugins/PluginProcessManager.h >index 5dcdd2c5f127571b825683ba0e4c38a397766969..a5c3fbead0906c934690ae3a3b9a6726fd58a57a 100644 >--- a/Source/WebKit/UIProcess/Plugins/PluginProcessManager.h >+++ b/Source/WebKit/UIProcess/Plugins/PluginProcessManager.h >@@ -64,6 +64,10 @@ public: > void deleteWebsiteData(const PluginModuleInfo&, WallTime modifiedSince, WTF::Function<void ()>&& completionHandler); > void deleteWebsiteDataForHostNames(const PluginModuleInfo&, const Vector<String>& hostNames, WTF::Function<void ()>&& completionHandler); > >+#if OS(LINUX) >+ void sendMemoryPressureEvent(bool isCritical); >+#endif >+ > #if PLATFORM(COCOA) > inline ProcessSuppressionDisabledToken processSuppressionDisabledToken(); > inline bool processSuppressionDisabled() const; >diff --git a/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp b/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp >index 4d0ddf8ea1aa44c5028495c30501191d7484c365..7a39f5b1aea9336d42a5cf215b10ed6c92335e44 100644 >--- a/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp >+++ b/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp >@@ -28,6 +28,7 @@ > > #if ENABLE(NETSCAPE_PLUGIN_API) > >+#include "ChildProcessMessages.h" > #include "PluginProcessConnectionManagerMessages.h" > #include "PluginProcessCreationParameters.h" > #include "PluginProcessManager.h" >@@ -38,10 +39,6 @@ > #include <WebCore/NotImplemented.h> > #include <wtf/RunLoop.h> > >-#if OS(LINUX) >-#include "MemoryPressureMonitor.h" >-#endif >- > using namespace WebCore; > > namespace WebKit { >@@ -155,6 +152,16 @@ void PluginProcessProxy::deleteWebsiteDataForHostNames(const Vector<String>& hos > m_connection->send(Messages::PluginProcess::DeleteWebsiteDataForHostNames(hostNames, callbackID), 0); > } > >+#if OS(LINUX) >+void PluginProcessProxy::sendMemoryPressureEvent(bool isCritical) >+{ >+ if (state() == State::Launching) >+ return; >+ >+ m_connection->send(Messages::ChildProcess::DidReceiveMemoryPressureEvent(isCritical), 0); >+} >+#endif >+ > void PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch() > { > // The plug-in process must have crashed or exited, send any pending sync replies we might have. >@@ -234,11 +241,6 @@ void PluginProcessProxy::didFinishLaunching(ProcessLauncher*, IPC::Connection::I > parameters.terminationTimeout = shutdownTimeout; > } > >-#if OS(LINUX) >- if (MemoryPressureMonitor::isEnabled()) >- parameters.memoryPressureMonitorHandle = MemoryPressureMonitor::singleton().createHandle(); >-#endif >- > platformInitializePluginProcess(parameters); > > // Initialize the plug-in host process. >diff --git a/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.h b/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.h >index 69c153decf61b40f89571ff2042bcc11cfa66fe3..9e86b85ba375b0abc3a81a30634ed3a23dfd3d03 100644 >--- a/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.h >+++ b/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.h >@@ -82,6 +82,10 @@ public: > void deleteWebsiteData(WallTime modifiedSince, WTF::Function<void ()>&& completionHandler); > void deleteWebsiteDataForHostNames(const Vector<String>& hostNames, WTF::Function<void ()>&& completionHandler); > >+#if OS(LINUX) >+ void sendMemoryPressureEvent(bool isCritical); >+#endif >+ > bool isValid() const { return m_connection; } > > #if PLUGIN_ARCHITECTURE(UNIX) >diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp >index c561bcb5014301cccba8920bf69ebbb4e8f5243a..6c3f0165ed2027261a3a5d5cd390b927152c0887 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.cpp >+++ b/Source/WebKit/UIProcess/WebProcessPool.cpp >@@ -49,6 +49,7 @@ > #include "NetworkProcessMessages.h" > #include "NetworkProcessProxy.h" > #include "PerActivityStateCPUUsageSampler.h" >+#include "PluginProcessManager.h" > #include "SandboxExtension.h" > #include "ServiceWorkerProcessProxy.h" > #include "StatisticsData.h" >@@ -269,6 +270,13 @@ WebProcessPool::WebProcessPool(API::ProcessPoolConfiguration& configuration) > > platformInitialize(); > >+ >+#if OS(LINUX) >+ // Start UIProcess memory monitor. >+ MemoryPressureMonitor::singleton(); >+#endif >+ >+ > addMessageReceiver(Messages::WebProcessPool::messageReceiverName(), *this); > > // NOTE: These sub-objects must be initialized after m_messageReceiverMap.. >@@ -413,6 +421,18 @@ void WebProcessPool::fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnable > sendToAllProcesses(Messages::WebProcess::FullKeyboardAccessModeChanged(fullKeyboardAccessEnabled)); > } > >+#if OS(LINUX) >+void WebProcessPool::sendMemoryPressureEvent(bool isCritical) >+{ >+ sendToAllProcesses(Messages::ChildProcess::DidReceiveMemoryPressureEvent(isCritical)); >+ sendToNetworkingProcess(Messages::ChildProcess::DidReceiveMemoryPressureEvent(isCritical)); >+ sendToStorageProcess(Messages::ChildProcess::DidReceiveMemoryPressureEvent(isCritical)); >+#if ENABLE(NETSCAPE_PLUGIN_API) >+ PluginProcessManager::singleton().sendMemoryPressureEvent(isCritical); >+#endif >+} >+#endif >+ > void WebProcessPool::textCheckerStateChanged() > { > sendToAllProcesses(Messages::WebProcess::SetTextCheckerState(TextChecker::state())); >@@ -490,11 +510,6 @@ NetworkProcessProxy& WebProcessPool::ensureNetworkProcess(WebsiteDataStore* with > SandboxExtension::createHandle(parentBundleDirectory, SandboxExtension::Type::ReadOnly, parameters.parentBundleDirectoryExtensionHandle); > #endif > >-#if OS(LINUX) >- if (MemoryPressureMonitor::isEnabled()) >- parameters.memoryPressureMonitorHandle = MemoryPressureMonitor::singleton().createHandle(); >-#endif >- > parameters.shouldUseTestingNetworkSession = m_shouldUseTestingNetworkSession; > parameters.presentingApplicationPID = m_configuration->presentingApplicationPID(); > >@@ -923,8 +938,6 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa > > #if OS(LINUX) > parameters.shouldEnableMemoryPressureReliefLogging = true; >- if (MemoryPressureMonitor::isEnabled()) >- parameters.memoryPressureMonitorHandle = MemoryPressureMonitor::singleton().createHandle(); > #endif > > #if PLATFORM(WAYLAND) && USE(EGL) >diff --git a/Source/WebKit/UIProcess/WebProcessPool.h b/Source/WebKit/UIProcess/WebProcessPool.h >index b5b5e4ac099a19708bda2adee5feb3f94b1e6a78..21d71f5f0a4c88d2996648fa6bc439ed1ee13fd8 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.h >+++ b/Source/WebKit/UIProcess/WebProcessPool.h >@@ -165,6 +165,7 @@ public: > template<typename T> void sendToNetworkingProcessRelaunchingIfNecessary(T&& message); > > // Sends the message to WebProcess or StorageProcess as approporiate for current process model. >+ template<typename T> void sendToStorageProcess(T&& message); > template<typename T> void sendToStorageProcessRelaunchingIfNecessary(T&& message); > > void processDidFinishLaunching(WebProcessProxy*); >@@ -313,7 +314,9 @@ public: > #endif > > void fullKeyboardAccessModeChanged(bool fullKeyboardAccessEnabled); >- >+#if OS(LINUX) >+ void sendMemoryPressureEvent(bool isCritical); >+#endif > void textCheckerStateChanged(); > > Ref<API::Dictionary> plugInAutoStartOriginHashes() const; >@@ -714,6 +717,13 @@ void WebProcessPool::sendToNetworkingProcessRelaunchingIfNecessary(T&& message) > } > > template<typename T> >+void WebProcessPool::sendToStorageProcess(T&& message) >+{ >+ if (m_storageProcess && m_storageProcess->canSendMessage()) >+ m_storageProcess->send(std::forward<T>(message), 0); >+} >+ >+template<typename T> > void WebProcessPool::sendToStorageProcessRelaunchingIfNecessary(T&& message) > { > ensureStorageProcessAndWebsiteDataStore(nullptr); >diff --git a/Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp b/Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp >index 357d9936cffbf81005ccbb96a2580a5de9668687..c2f436a27cf9e76fd740569dd3e7f6dee3af5504 100644 >--- a/Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp >+++ b/Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Igalia S.L. >+ * Copyright (C) 2016, 2018 Igalia S.L. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -28,15 +28,10 @@ > > #if OS(LINUX) > >-#include "Attachment.h" >-#include <errno.h> >-#include <fcntl.h> >-#include <mutex> >+#include "WebProcessPool.h" >+#include <stdio.h> > #include <stdlib.h> > #include <string.h> >-#include <sys/eventfd.h> >-#include <sys/stat.h> >-#include <sys/types.h> > #include <unistd.h> > #include <wtf/Threading.h> > #include <wtf/UniStdExtras.h> >@@ -48,8 +43,9 @@ static const size_t notSet = static_cast<size_t>(-1); > static const Seconds s_minPollingInterval { 1_s }; > static const Seconds s_maxPollingInterval { 5_s }; > static const double s_minUsedMemoryPercentageForPolling = 50; >-static const double s_maxUsedMemoryPercentageForPolling = 90; >-static const int s_memoryPresurePercentageThreshold = 95; >+static const double s_maxUsedMemoryPercentageForPolling = 85; >+static const int s_memoryPresurePercentageThreshold = 90; >+static const int s_memoryPresurePercentageThresholdCritical = 95; > > static size_t lowWatermarkPages() > { >@@ -208,30 +204,7 @@ static inline Seconds pollIntervalForUsedMemoryPercentage(int usedPercentage) > return s_minPollingInterval; > > return s_minPollingInterval + (s_maxPollingInterval - s_minPollingInterval) * >- ((usedPercentage - s_minUsedMemoryPercentageForPolling) / (s_maxUsedMemoryPercentageForPolling - s_minUsedMemoryPercentageForPolling)); >-} >- >-static bool isSystemdMemoryPressureMonitorAvailable() >-{ >- int fd = open("/sys/fs/cgroup/memory/memory.pressure_level", O_CLOEXEC | O_RDONLY); >- if (fd == -1) >- return false; >- close(fd); >- >- fd = open("/sys/fs/cgroup/memory/cgroup.event_control", O_CLOEXEC | O_WRONLY); >- if (fd == -1) >- return false; >- close(fd); >- >- return true; >-} >- >-bool MemoryPressureMonitor::isEnabled() >-{ >- static std::once_flag onceFlag; >- static bool enabled; >- std::call_once(onceFlag, [] { enabled = !isSystemdMemoryPressureMonitorAvailable(); }); >- return enabled; >+ ((s_maxUsedMemoryPercentageForPolling - usedPercentage) / (s_maxUsedMemoryPercentageForPolling - s_minUsedMemoryPercentageForPolling)); > } > > MemoryPressureMonitor& MemoryPressureMonitor::singleton() >@@ -242,11 +215,7 @@ MemoryPressureMonitor& MemoryPressureMonitor::singleton() > } > > MemoryPressureMonitor::MemoryPressureMonitor() >- : m_eventFD(eventfd(0, EFD_CLOEXEC)) > { >- if (m_eventFD == -1) >- return; >- > Thread::create("MemoryPressureMonitor", [this] { > Seconds pollInterval = s_maxPollingInterval; > while (true) { >@@ -259,26 +228,15 @@ MemoryPressureMonitor::MemoryPressureMonitor() > } > > if (usedPercentage >= s_memoryPresurePercentageThreshold) { >- uint64_t fdEvent = 1; >- ssize_t bytesWritten = write(m_eventFD, &fdEvent, sizeof(uint64_t)); >- if (bytesWritten != sizeof(uint64_t)) { >- WTFLogAlways("Error writing to MemoryPressureMonitor eventFD: %s", strerror(errno)); >- break; >- } >+ bool isCritical = (usedPercentage >= s_memoryPresurePercentageThresholdCritical); >+ for (auto* processPool : WebProcessPool::allProcessPools()) >+ processPool->sendMemoryPressureEvent(isCritical); > } > pollInterval = pollIntervalForUsedMemoryPercentage(usedPercentage); > } >- close(m_eventFD); > })->detach(); > } > >-IPC::Attachment MemoryPressureMonitor::createHandle() const >-{ >- int duplicatedHandle = dupCloseOnExec(m_eventFD); >- if (duplicatedHandle == -1) >- return { }; >- return IPC::Attachment(duplicatedHandle); >-} > > } // namespace WebKit > >diff --git a/Source/WebKit/UIProcess/linux/MemoryPressureMonitor.h b/Source/WebKit/UIProcess/linux/MemoryPressureMonitor.h >index e250c855171f839f438966a7b6d85c995dfa5fc0..2003713afd6504ea9d730fb5f11601ee64857c8c 100644 >--- a/Source/WebKit/UIProcess/linux/MemoryPressureMonitor.h >+++ b/Source/WebKit/UIProcess/linux/MemoryPressureMonitor.h >@@ -41,16 +41,11 @@ class MemoryPressureMonitor { > friend NeverDestroyed<MemoryPressureMonitor>; > public: > static MemoryPressureMonitor& singleton(); >- static bool isEnabled(); > > ~MemoryPressureMonitor(); > >- IPC::Attachment createHandle() const; >- > private: > MemoryPressureMonitor(); >- >- int m_eventFD { -1 }; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp >index 0e8370485aa99da8e3e41b91cdf2367c2933204e..50800d03ef72809d425d3dfb100f5e7f9933b792 100644 >--- a/Source/WebKit/WebProcess/WebProcess.cpp >+++ b/Source/WebKit/WebProcess/WebProcess.cpp >@@ -270,8 +270,6 @@ void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters) > WebCore::setPresentingApplicationPID(parameters.presentingApplicationPID); > > #if OS(LINUX) >- if (parameters.memoryPressureMonitorHandle.fileDescriptor() != -1) >- MemoryPressureHandler::singleton().setMemoryPressureMonitorHandle(parameters.memoryPressureMonitorHandle.releaseFileDescriptor()); > MemoryPressureHandler::ReliefLogger::setLoggingEnabled(parameters.shouldEnableMemoryPressureReliefLogging); > #endif >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 184261
:
337074
|
340167
|
340174
|
341087
|
341092
|
341194
|
341208