Title: [190937] releases/WebKitGTK/webkit-2.10/Source/WebKit2
Revision
190937
Author
[email protected]
Date
2015-10-13 02:19:22 -0700 (Tue, 13 Oct 2015)

Log Message

Merge r190121 - [WK2][NetworkCache] New entry bodies remain in dirty memory after being written to disk.
<https://webkit.org/b/149463>

Reviewed by Antti Koivisto.

Call msync(MS_ASYNC) on cache entry bodies after writing their data to a
memory-mapped file. This turns the previously dirty memory into clean memory,
reducing our effective footprint.

I previously believed this would happen automatically when the kernel finds
itself under memory pressure, around the same time as it starts dropping
volatile pages. Turns out that's not the case. Even under considerable pressure,
we never flush this memory to file. So let's take care of it ourselves.

If this ends up generating more IO activity than we're comfortable with on some
scenario, we can look at throttling.

* NetworkProcess/cache/NetworkCacheData.cpp:
(WebKit::NetworkCache::Data::mapToFile):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog (190936 => 190937)


--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog	2015-10-13 09:18:24 UTC (rev 190936)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/ChangeLog	2015-10-13 09:19:22 UTC (rev 190937)
@@ -1,3 +1,25 @@
+2015-09-22  Andreas Kling  <[email protected]>
+
+        [WK2][NetworkCache] New entry bodies remain in dirty memory after being written to disk.
+        <https://webkit.org/b/149463>
+
+        Reviewed by Antti Koivisto.
+
+        Call msync(MS_ASYNC) on cache entry bodies after writing their data to a
+        memory-mapped file. This turns the previously dirty memory into clean memory,
+        reducing our effective footprint.
+
+        I previously believed this would happen automatically when the kernel finds
+        itself under memory pressure, around the same time as it starts dropping
+        volatile pages. Turns out that's not the case. Even under considerable pressure,
+        we never flush this memory to file. So let's take care of it ourselves.
+
+        If this ends up generating more IO activity than we're comfortable with on some
+        scenario, we can look at throttling.
+
+        * NetworkProcess/cache/NetworkCacheData.cpp:
+        (WebKit::NetworkCache::Data::mapToFile):
+
 2015-09-21  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.10.0 release.

Modified: releases/WebKitGTK/webkit-2.10/Source/WebKit2/NetworkProcess/cache/NetworkCacheData.cpp (190936 => 190937)


--- releases/WebKitGTK/webkit-2.10/Source/WebKit2/NetworkProcess/cache/NetworkCacheData.cpp	2015-10-13 09:18:24 UTC (rev 190936)
+++ releases/WebKitGTK/webkit-2.10/Source/WebKit2/NetworkProcess/cache/NetworkCacheData.cpp	2015-10-13 09:19:22 UTC (rev 190937)
@@ -62,6 +62,9 @@
     // Drop the write permission.
     mprotect(map, m_size, PROT_READ);
 
+    // Flush (asynchronously) to file, turning this into clean memory.
+    msync(map, m_size, MS_ASYNC);
+
     return Data::adoptMap(map, m_size, fd);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to