Bug 226404 - New malloc algorithm
Summary: New malloc algorithm
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: bmalloc (show other bugs)
Version: Other
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords: InRadar
Depends on:
Blocks: 227177
  Show dependency treegraph
 
Reported: 2021-05-28 16:30 PDT by Filip Pizlo
Modified: 2021-07-14 13:50 PDT (History)
18 users (show)

See Also:


Attachments
a work in progress version of the patch (5.22 MB, patch)
2021-05-28 16:31 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
updated patch (4.29 MB, patch)
2021-06-06 12:36 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
updated patch (4.29 MB, patch)
2021-06-09 17:23 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
updated patch (4.29 MB, patch)
2021-06-09 17:24 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (4.44 MB, patch)
2021-06-17 21:09 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (4.41 MB, patch)
2021-06-18 17:53 PDT, Filip Pizlo
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
the patch (4.41 MB, patch)
2021-06-19 16:36 PDT, Filip Pizlo
ysuzuki: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (4.58 MB, patch)
2021-07-09 19:36 PDT, Yusuke Suzuki
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (4.59 MB, patch)
2021-07-09 20:12 PDT, Yusuke Suzuki
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (4.59 MB, patch)
2021-07-09 20:19 PDT, Yusuke Suzuki
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (4.44 MB, patch)
2021-07-10 10:24 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (4.44 MB, patch)
2021-07-12 11:20 PDT, Yusuke Suzuki
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (4.44 MB, patch)
2021-07-12 21:59 PDT, Yusuke Suzuki
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.