Bug 140900

Summary: Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
Product: WebKit Reporter: Geoffrey Garen <ggaren>
Component: New BugsAssignee: Geoffrey Garen <ggaren>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, ap, benjamin, bfulgham, cmarcelo, commit-queue, kling, mhahnenb, ossy, roger_fong, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 140951, 140953, 141119    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
run-jsc-benchmarks results
none
Patch
none
Patch
none
Patch
none
Patch kling: review+

Geoffrey Garen
Reported 2015-01-26 13:44:41 PST
Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
Attachments
Patch (89.40 KB, patch)
2015-01-26 14:00 PST, Geoffrey Garen
no flags
run-jsc-benchmarks results (52.15 KB, text/plain)
2015-01-26 14:01 PST, Geoffrey Garen
no flags
Patch (90.07 KB, patch)
2015-01-26 15:40 PST, Geoffrey Garen
no flags
Patch (9.65 KB, patch)
2015-03-05 19:42 PST, Geoffrey Garen
no flags
Patch (6.53 KB, patch)
2015-03-06 16:07 PST, Geoffrey Garen
no flags
Patch (59.08 KB, patch)
2015-03-07 13:19 PST, Geoffrey Garen
kling: review+
Geoffrey Garen
Comment 1 2015-01-26 14:00:27 PST
Geoffrey Garen
Comment 2 2015-01-26 14:01:41 PST
Created attachment 245374 [details] run-jsc-benchmarks results Uploading performance results.
Mark Hahnenberg
Comment 3 2015-01-26 14:11:59 PST
Comment on attachment 245372 [details] Patch Lots of red, me gusta :-) Looks like builds are angry. r=me w/ fixes. What's bmalloc's story for returning memory to the OS? I'm assuming it's something similar to what BlockAllocator did, just curious.
Geoffrey Garen
Comment 4 2015-01-26 14:37:51 PST
> What's bmalloc's story for returning memory to the OS? I'm assuming it's > something similar to what BlockAllocator did, just curious. bmalloc uses a timer on a background thread with back-off if other threads start asking the heap to grow -- very similar to what BlockAllocator did.
Geoffrey Garen
Comment 5 2015-01-26 15:40:56 PST
Geoffrey Garen
Comment 6 2015-01-26 15:41:39 PST
Trying to fix the build...
Geoffrey Garen
Comment 7 2015-01-27 10:29:27 PST
Csaba Osztrogonác
Comment 8 2015-01-27 12:07:45 PST
Csaba Osztrogonác
Comment 9 2015-01-27 12:09:54 PST
Csaba Osztrogonác
Comment 10 2015-01-27 12:11:55 PST
Alexey Proskuryakov
Comment 11 2015-01-27 12:30:51 PST
Strangely, it seems flaky. I forced clean builds on Yosemite, although there probably is a real problem.
WebKit Commit Bot
Comment 12 2015-01-27 12:49:56 PST
Re-opened since this is blocked by bug 140951
Csaba Osztrogonác
Comment 14 2015-01-27 13:04:58 PST
more info: There are 2 Yosemite bots: - https://build.webkit.org/buildslaves/bot191 (pass) - https://build.webkit.org/buildslaves/bot190 (fail) - https://build.webkit.org/buildslaves/bot192 (fail) - https://build.webkit.org/buildslaves/bot193 (pass) ... but failures occure only one of them. Maybe there are some black magic intalled on them which is necessary to make tests pass.
Csaba Osztrogonác
Comment 15 2015-01-27 13:18:15 PST
any plan to fix this serious regression?
Alexey Proskuryakov
Comment 16 2015-01-27 14:16:22 PST
Matt rolled this out in r179211, however Mac Yosemite bots went green even before that. We did a clean build, and also there was a seemingly unrelated patch landed in the meanwhile (http://trac.webkit.org/changeset/179202). Not sure about ARM and 32-bit tests.
Geoffrey Garen
Comment 17 2015-01-29 11:20:03 PST
Geoffrey Garen
Comment 18 2015-01-29 13:41:28 PST
Geoffrey Garen
Comment 19 2015-01-30 11:57:30 PST
Geoffrey Garen
Comment 20 2015-01-30 16:51:00 PST
Andreas Kling
Comment 21 2015-01-31 00:28:38 PST
(In reply to comment #20) > Committed r179426: <http://trac.webkit.org/changeset/179426> Looks like ~7% memory use regression on the ol' buster.
WebKit Commit Bot
Comment 22 2015-01-31 10:24:01 PST
Re-opened since this is blocked by bug 141119
Andreas Kling
Comment 23 2015-01-31 16:54:18 PST
Geoffrey Garen
Comment 24 2015-02-02 14:27:11 PST
Geoffrey Garen
Comment 25 2015-03-05 19:41:57 PST
Reopening to attach new patch.
Geoffrey Garen
Comment 26 2015-03-05 19:42:02 PST
Geoffrey Garen
Comment 27 2015-03-05 19:44:42 PST
> > Committed r179361: <http://trac.webkit.org/changeset/179361> > > Looks like ~40% regression on Bindings/create-element from this change: > > https://perf.webkit.org/#mode=charts&chartList=%5B%5B%22mac- > mavericks%22%2C%22Bindings%2Fcreate-element%3ARuns%22%5D%5D This regression mysteriously disappeared after a bmalloc refactoring patch.
Geoffrey Garen
Comment 28 2015-03-06 08:59:15 PST
Csaba Osztrogonác
Comment 29 2015-03-06 09:34:28 PST
Csaba Osztrogonác
Comment 30 2015-03-06 09:35:42 PST
Csaba Osztrogonác
Comment 31 2015-03-06 10:17:17 PST
Geoffrey, are you working on fixing the regression on 32 bit bots?
Geoffrey Garen
Comment 32 2015-03-06 11:48:51 PST
sunspider-1.0/access-nsieve.js.default: ASSERTION FAILED: is8ByteAligned(reinterpret_cast<void*>(m_remaining)) sunspider-1.0/access-nsieve.js.default: /Volumes/Data/slave/mavericks-32bitJSC-debug/build/Source/JavaScriptCore/heap/CopiedBlock.h(156) : JSC::CopiedBlock::CopiedBlock(size_t) sunspider-1.0/access-nsieve.js.default: 1 0xaf561d WTFCrash sunspider-1.0/access-nsieve.js.default: 2 0x2752f2 JSC::CopiedBlock::CopiedBlock(unsigned long) sunspider-1.0/access-nsieve.js.default: 3 0x2751d4 JSC::CopiedBlock::CopiedBlock(unsigned long) sunspider-1.0/access-nsieve.js.default: 4 0x2751a1 JSC::CopiedBlock::createNoZeroFill(unsigned long) sunspider-1.0/access-nsieve.js.default: 5 0x2723e7 JSC::CopiedBlock::create(unsigned long) sunspider-1.0/access-nsieve.js.default: 6 0x270bc1 JSC::CopiedSpace::tryAllocateOversize(unsigned long, void**)
Geoffrey Garen
Comment 33 2015-03-06 12:00:52 PST
I think sizeof(CopiedBlock) must not be 8-byte-aligned on 32-bit platforms. I'm regression-testing a fix.
Geoffrey Garen
Comment 34 2015-03-06 12:21:11 PST
Csaba Osztrogonác
Comment 35 2015-03-06 13:04:54 PST
Geoffrey Garen
Comment 36 2015-03-06 14:03:24 PST
Committed revision 181180: <http://trac.webkit.org/changeset/181180>.
Geoffrey Garen
Comment 37 2015-03-06 16:07:00 PST
Reopening to attach new patch.
Geoffrey Garen
Comment 38 2015-03-06 16:07:05 PST
Geoffrey Garen
Comment 39 2015-03-07 11:04:33 PST
Geoffrey Garen
Comment 40 2015-03-07 13:19:12 PST
Reopening to attach new patch.
Geoffrey Garen
Comment 41 2015-03-07 13:19:37 PST
Geoffrey Garen
Comment 42 2015-03-07 13:21:38 PST
> Looks like ~7% memory use regression on the ol' buster. This regression did not reappear in re-landing this patch broken out into pieces, probably because of these improvements to bmalloc: https://bugs.webkit.org/show_bug.cgi?id=142055 https://bugs.webkit.org/show_bug.cgi?id=142058 https://bugs.webkit.org/show_bug.cgi?id=142194
Andreas Kling
Comment 43 2015-03-07 13:33:11 PST
Comment on attachment 248166 [details] Patch rs=me to remove, but one thing needs fixing: /Volumes/Data/EWS/WebKit/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm:156:42: error: no member named 'blockAllocator' in 'JSC::Heap' JSDOMWindowBase::commonVM().heap.blockAllocator().releaseFreeRegions(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ 1 error generated.
Geoffrey Garen
Comment 44 2015-03-07 16:23:27 PST
Note You need to log in before you can comment on or make changes to this bug.