Bug 226404

Summary: New malloc algorithm
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: bmallocAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, benjamin, cdumez, cmarcelo, ews-watchlist, ggaren, gyuyoung.kim, keith_miller, mark.lam, mitz, msaboff, pmatos, ryuan.choi, sbarati, sergio, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=227927
Bug Depends on:    
Bug Blocks: 227177    
Attachments:
Description Flags
a work in progress version of the patch
none
updated patch
none
updated patch
none
updated patch
none
the patch
none
the patch
ews-feeder: commit-queue-
the patch
ysuzuki: review+, ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
none
Patch
ews-feeder: commit-queue-
Patch ews-feeder: commit-queue-

Description Filip Pizlo 2021-05-28 16:30:21 PDT
...
Comment 1 Filip Pizlo 2021-05-28 16:31:53 PDT
Created attachment 430071 [details]
a work in progress version of the patch
Comment 2 Radar WebKit Bug Importer 2021-06-04 16:31:31 PDT
<rdar://problem/78891275>
Comment 3 Filip Pizlo 2021-06-06 12:36:04 PDT
Created attachment 430695 [details]
updated patch

1.5% speed-up on Speedometer2.  Neutral on JS2.  10% memory savings on a bunch of different memory benchmarks.

This version replaces bmalloc, IsoHeaps, gigacage, and MetaAllocator.
Comment 4 Yusuke Suzuki 2021-06-08 23:39:24 PDT
(In reply to Filip Pizlo from comment #3)
> Created attachment 430695 [details]
> updated patch
> 
> 1.5% speed-up on Speedometer2.  Neutral on JS2.  10% memory savings on a
> bunch of different memory benchmarks.
> 
> This version replaces bmalloc, IsoHeaps, gigacage, and MetaAllocator.

Wow, that's awesome
Comment 5 Filip Pizlo 2021-06-09 17:23:08 PDT
Created attachment 431028 [details]
updated patch
Comment 6 Filip Pizlo 2021-06-09 17:24:46 PDT
Created attachment 431029 [details]
updated patch
Comment 7 Paulo Matos 2021-06-10 01:16:49 PDT
I am having issues compiling with this patch. I see bmalloc_heap_inlines.h and bmalloc_heap_ref.h in libpas but bmalloc/*.cpp files cannot find it and complain during build causing it to fail. 

Given you have results of running the patch, it seems you have compiled. Have I missed anything on building besides:
$ Tools/Scripts/webkit-patch apply-from-bug 226404
$ Tools/Scripts/build-jsc --jsc-only --debug
Comment 8 Filip Pizlo 2021-06-10 08:04:57 PDT
(In reply to Paulo Matos from comment #7)
> I am having issues compiling with this patch. I see bmalloc_heap_inlines.h
> and bmalloc_heap_ref.h in libpas but bmalloc/*.cpp files cannot find it and
> complain during build causing it to fail. 

They find those files just fine with xcodebuild. 

> 
> Given you have results of running the patch, it seems you have compiled.
> Have I missed anything on building besides:
> $ Tools/Scripts/webkit-patch apply-from-bug 226404
> $ Tools/Scripts/build-jsc --jsc-only --debug

It’s not supported on non-Darwin platforms. You might be able to make it work on non-Darwin platforms but that’ll probably require nontrivial work.
Comment 9 Paulo Matos 2021-06-14 09:02:15 PDT
Thanks - I managed to build it through xcode. 

I wanted to understand the implications of this patch for 32bits before it lands and breaks the 32bit world. I will keep an eye on the patch as it develops.
Comment 10 Filip Pizlo 2021-06-14 09:04:36 PDT
(In reply to Paulo Matos from comment #9)
> Thanks - I managed to build it through xcode. 
> 
> I wanted to understand the implications of this patch for 32bits before it
> lands and breaks the 32bit world. I will keep an eye on the patch as it
> develops.

I think it'll land disabled in 32-bit.
Comment 11 Filip Pizlo 2021-06-17 21:09:27 PDT
Created attachment 431753 [details]
the patch
Comment 12 Filip Pizlo 2021-06-17 21:50:47 PDT
Looks like a perfect score so far!
Comment 13 Filip Pizlo 2021-06-18 17:53:17 PDT
Created attachment 431788 [details]
the patch

Should apply and build on more things now.
Comment 14 Filip Pizlo 2021-06-19 16:36:57 PDT
Created attachment 431809 [details]
the patch
Comment 15 Yusuke Suzuki 2021-07-09 19:36:24 PDT
Created attachment 433252 [details]
Patch

Update to apply libpas to executable allocator for now
Comment 16 Yusuke Suzuki 2021-07-09 20:12:55 PDT
Created attachment 433255 [details]
Patch
Comment 17 Yusuke Suzuki 2021-07-09 20:19:32 PDT
Created attachment 433256 [details]
Patch
Comment 18 Yusuke Suzuki 2021-07-10 10:24:11 PDT
Created attachment 433260 [details]
Patch
Comment 19 Yusuke Suzuki 2021-07-12 11:20:42 PDT
Created attachment 433334 [details]
Patch
Comment 20 Yusuke Suzuki 2021-07-12 15:00:07 PDT
Discussed with Phil. My patch is basically adjusting libpas to make it under executable-allocator and bmalloc (and this is basically small changes).
I'll review libpas things.
Comment 21 Yusuke Suzuki 2021-07-12 21:31:29 PDT
Comment on attachment 431809 [details]
the patch

r=me
Comment 22 Yusuke Suzuki 2021-07-12 21:59:12 PDT
Created attachment 433388 [details]
Patch
Comment 23 Yusuke Suzuki 2021-07-13 00:39:45 PDT
Committed r279867 (239620@main): <https://commits.webkit.org/239620@main>
Comment 24 Yusuke Suzuki 2021-07-14 13:50:55 PDT
This is currently only enabled for macOS ARM64 executable allocator.