[Webkit-unassigned] [Bug 155255] MemoryPressureHandler doesn't work if cgroups aren't present in Linux
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jun 28 07:55:36 PDT 2016
https://bugs.webkit.org/show_bug.cgi?id=155255
--- Comment #26 from Antonio Gomes <tonikitoo at webkit.org> ---
(In reply to comment #25)
> Comment on attachment 273833 [details]
> Patch
>
> I think this patch needs to address clopez's feedback:
>
> """Regarding the concerns about that the wakeups could affect the battery
> life I propose that we only enable this fallback memory pressure handler
> when the system is not running on battery.
>
> We can reliably detect this by inspecting some values on /sys. For example,
> we can borrow either the systemd implementation to detect this
> <https://github.com/systemd/systemd/blob/master/src/basic/util.c#L498> or
> the e2fsprogs one
> <http://git.kernel.org/cgit/fs/ext2/e2fsprogs.git/tree/e2fsck/unix.c#n284>
> (yes, fsck avoids running automatically if it detects you are on battery)
>
>
> And I don't think we should hide this feature behind an obscure environment
> variable than other than we developers and power users will know about, but
> make it run by default when the cgroup based memory pressure handler fails
> and when the system is not running on battery."""
For the record, on ChromeOS, the kernel provides a file (available for reading if system is under low mem conditions):
// This is the file that will exist if low memory notification is available
// on the device. Whenever it becomes readable, it signals a low memory
// condition.
const char kLowMemFile[] = "/dev/chromeos-low-mem";
No parsing needed of its content, just verifying its presence is enough.
The check happens every 1s, and I believe it would not be as expensive as actually reading and parsing /proc/meminfo every 1s.
If Linux would have something like this by default, it would do it, as far as I can tell.
--
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/20160628/ed85baed/attachment-0001.html>
More information about the webkit-unassigned
mailing list