[Webkit-unassigned] [Bug 159346] [GLib] Use a GSource instead of a thread to poll memory pressure eventFD in linux implementation
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Jul 13 08:43:07 PDT 2016
https://bugs.webkit.org/show_bug.cgi?id=159346
Antonio Gomes <tonikitoo at webkit.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #283522|review? |review+
Flags| |
--- Comment #9 from Antonio Gomes <tonikitoo at webkit.org> ---
Comment on attachment 283522
--> https://bugs.webkit.org/attachment.cgi?id=283522
Updated patch
View in context: https://bugs.webkit.org/attachment.cgi?id=283522&action=review
r=me.
I think I can't make use of it yet out of the box on my Linux box, because applications (including webkit based browsers) can not read '/sys/fs/cgroup/memory/memory.pressure_level'.
$ ls -ls /sys/fs/cgroup/memory/
(..)
0 --w--w--w-. 1 root root 0 Jul 5 11:37 cgroup.event_control
(..)
0 ----------. 1 root root 0 Jul 5 11:37 memory.pressure_level
(..)
I have to manually change the permissions.
>>> Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp:230
>>> + m_eventFDPoller = std::make_unique<EventFDPoller>(m_eventFD.value(), [this] {
>>
>> So my understand is that m_eventFDPoller is an alternative memory pressure source that works independent from the existing 'cgroup' solution, right?
>>
>> However, it gets initialized after the cgroup initialization stuff (lines 209 and 215). So, if cgroup fails to initialize - which happens in most cases - then ::install bails out earlier (lines 218 and 225) and line 230 is not executed.
>>
>> Should line 230 be our first option, and cgroup the second?
>
> No, cgroups work with an evenfd. You create an eventfd and pass the file descriptor to the cgroup event control, by writing a line to /sys/fs/cgroup/memory/cgroup.event_control. The kernel uses the passed fd to notify about critical memory situations. In bug #155255 I also use an eventfd because it's light an efficient and we can reuse most of the cgroups code.
Ok.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160713/f89c36d9/attachment.html>
More information about the webkit-unassigned
mailing list