Bug 152362

Summary: Give kernel VM some hints about non-live memory-cached resources.
Product: WebKit Reporter: Andreas Kling <kling>
Component: WebCore Misc.Assignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, benjamin, cdumez, cmarcelo, commit-queue, japhet, koivisto
Priority: P2 Keywords: Performance
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ggaren: review+, buildbot: commit-queue-
Archive of layout-test-results from ews116 for mac-yosemite
none
Patch for landing
none
Patch for landing
commit-queue: commit-queue-
Patch for landing none

Description Andreas Kling 2015-12-16 15:04:47 PST
We could improve our Good Citizen Score(tm) on the system by letting the kernel know that it's OK to reclaim clean file-backed pages for memory-cached resources that are not currently in use.

They would eventually get reclaimed anyway, but this patch will be about nudging them to the head of the eviction queue through madvise(MADV_DONTNEED).
Comment 1 Andreas Kling 2015-12-16 15:05:52 PST
Created attachment 267496 [details]
Patch
Comment 2 Geoffrey Garen 2015-12-16 15:32:52 PST
Comment on attachment 267496 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=267496&action=review

> Source/WebCore/platform/cf/SharedBufferCF.cpp:81
> +    OSAllocator::hintMemoryNotNeededSoon((void*)platformData(), platformDataSize());

I don't think you need a cast here? If you do need one, static_cast please.
Comment 3 Build Bot 2015-12-16 16:14:34 PST
Comment on attachment 267496 [details]
Patch

Attachment 267496 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/568817

New failing tests:
imported/w3c/web-platform-tests/streams-api/readable-streams/garbage-collection.html
Comment 4 Build Bot 2015-12-16 16:14:38 PST
Created attachment 267507 [details]
Archive of layout-test-results from ews116 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 5 Andreas Kling 2015-12-16 16:41:55 PST
Created attachment 267510 [details]
Patch for landing
Comment 6 Andreas Kling 2015-12-16 17:36:30 PST
Created attachment 267513 [details]
Patch for landing

With Windows fixed.
Comment 7 WebKit Commit Bot 2015-12-16 17:37:51 PST
Comment on attachment 267513 [details]
Patch for landing

Rejecting attachment 267513 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'validate-changelog', '--check-oops', '--non-interactive', 267513, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Geoff Garen found in /Volumes/Data/EWS/WebKit/Source/WTF/ChangeLog does not appear to be a valid reviewer according to contributors.json.
/Volumes/Data/EWS/WebKit/Source/WTF/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).

Full output: http://webkit-queues.webkit.org/results/569195
Comment 8 Andreas Kling 2015-12-16 17:59:03 PST
Created attachment 267515 [details]
Patch for landing

s/Geoff/Geoffrey/ :|
Comment 9 WebKit Commit Bot 2015-12-16 18:55:29 PST
Comment on attachment 267515 [details]
Patch for landing

Clearing flags on attachment: 267515

Committed r194204: <http://trac.webkit.org/changeset/194204>
Comment 10 WebKit Commit Bot 2015-12-16 18:55:35 PST
All reviewed patches have been landed.  Closing bug.