Bug 172373 - bmalloc: scavenger runs too much on JetStream
Summary: bmalloc: scavenger runs too much on JetStream
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Geoffrey Garen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-05-19 11:58 PDT by Geoffrey Garen
Modified: 2018-04-17 04:02 PDT (History)
8 users (show)

See Also:


Attachments
Patch (18.10 KB, patch)
2017-05-19 12:48 PDT, Geoffrey Garen
sam: review+
Details | Formatted Diff | Diff
Updated Patch (18.56 KB, patch)
2017-05-25 15:36 PDT, Michael Saboff
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Garen 2017-05-19 11:58:51 PDT
bmalloc: scavenger runs too much on JetStream
Comment 1 Geoffrey Garen 2017-05-19 12:48:41 PDT
Created attachment 310685 [details]
Patch
Comment 2 Build Bot 2017-05-19 12:50:53 PDT
Attachment 310685 [details] did not pass style-queue:


ERROR: Source/bmalloc/bmalloc/AsyncTask.h:129:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Sam Weinig 2017-05-19 13:20:20 PDT
Comment on attachment 310685 [details]
Patch

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

> Source/bmalloc/ChangeLog:28
> +        One hole in this strategy is that a workload with a perfectly
> +        unfragmented heap that allocates and deallocates ~16kB every 2s will
> +        never shrink its heap. This doesn't seem to be a problem in practice.

Presumably, once it reaches critical memory pressure, it will still shrink?
Comment 4 Geoffrey Garen 2017-05-19 14:40:07 PDT
> Presumably, once it reaches critical memory pressure, it will still shrink?

Yes.
Comment 5 Michael Saboff 2017-05-25 15:36:51 PDT
Created attachment 311304 [details]
Updated Patch

Tested this on iOS.  Working with Geoff, we made a few changes.
Comment 6 Build Bot 2017-05-25 15:39:20 PDT
Attachment 311304 [details] did not pass style-queue:


ERROR: Source/bmalloc/bmalloc/AsyncTask.h:129:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/bmalloc/bmalloc/Heap.cpp:204:  Multi line control clauses should use braces.  [whitespace/braces] [4]
ERROR: Source/bmalloc/bmalloc/Heap.cpp:209:  Multi line control clauses should use braces.  [whitespace/braces] [4]
ERROR: Source/bmalloc/bmalloc/Heap.cpp:212:  Multi line control clauses should use braces.  [whitespace/braces] [4]
ERROR: Source/bmalloc/bmalloc/Heap.cpp:223:  Multi line control clauses should use braces.  [whitespace/braces] [4]
Total errors found: 5 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Geoffrey Garen 2017-05-25 15:42:10 PDT
Comment on attachment 311304 [details]
Updated Patch

r=me
Comment 8 Michael Saboff 2017-05-25 16:11:26 PDT
Committed r217456: <http://trac.webkit.org/changeset/217456>
Comment 9 Radar WebKit Bug Importer 2017-05-30 20:27:02 PDT
<rdar://problem/32479828>
Comment 10 Saam Barati 2017-06-14 11:40:06 PDT
It looks like this or https://bugs.webkit.org/show_bug.cgi?id=172617 is a 1.5% slowdown on JetStream on iOS.
Comment 11 Andreas Kling 2017-06-23 16:33:15 PDT
Note that if the vm.madvise_free_debug sysctl is 1, madvise(MADV_FREE_*) will synchronously zero-fill the pages. This may result in very different performance characteristics on production vs engineering builds of the OS.