Closed Bug 1854550 Opened 8 months ago Closed 8 months ago

Decouple PHC from replace_malloc

Categories

(Core :: Memory Allocator, task, P1)

task

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: pbone, Assigned: pbone)

References

(Blocks 1 open bug)

Details

Attachments

(12 files, 4 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
No description provided.
Blocks: 1854135

We want to link PHC directly alongside jemalloc so move its code into the
memory/build/ directory. This means that it's always statically linked even
when other replace_malloc libraries aren't.

The following patch will remove it from the replace_malloc configuration.

Depends on D188982

Attachment #9354593 - Attachment description: WIP: Bug 1854550 - Fix a comment → WIP: Bug 1854550 - pt 1. Fix a comment
Attachment #9354594 - Attachment description: WIP: Bug 1854550 - Move PHC into memory/build → WIP: Bug 1854550 - pt 2. Move PHC into memory/build
Attachment #9354593 - Attachment description: WIP: Bug 1854550 - pt 1. Fix a comment → Bug 1854550 - pt 1. Fix a comment r=glandium

Depends on D188982

Attachment #9354594 - Attachment description: WIP: Bug 1854550 - pt 2. Move PHC into memory/build → Bug 1854550 - pt 3. Move PHC into memory/build r=glandium
Attachment #9355102 - Attachment description: WIP: Bug 1854550 - pt 3. PHC doesn't use the malloc table to call jemalloc → WIP: Bug 1854550 - pt 5. PHC doesn't use the malloc table to call jemalloc

This will simplify references/linking between mozjemalloc and PHC. Plus
this code is clearer (more explicit) without it even though there's more
repitition.

Depends on D189241

Attachment #9356536 - Attachment is obsolete: true
Attachment #9354594 - Attachment description: Bug 1854550 - pt 3. Move PHC into memory/build r=glandium → Bug 1854550 - pt 2. Move PHC into memory/build r=glandium
Attachment #9356537 - Attachment description: Bug 1854550 - pt 4. Define kAllocJunk once for jemalloc and PHC r=glandium → Bug 1854550 - pt 3. Define kAllocJunk once for jemalloc and PHC r=glandium
Attachment #9355102 - Attachment description: WIP: Bug 1854550 - pt 5. PHC doesn't use the malloc table to call jemalloc → WIP: Bug 1854550 - pt 4. PHC doesn't use the malloc table to call jemalloc
Attachment #9356538 - Attachment description: WIP: Bug 1854550 - pt 6. Remove templating around allocation classes → WIP: Bug 1854550 - pt 5. Remove templating around allocation classes

Move the AlignedAllocator class template into mozjemalloc.h where it can be
used by PHC also.

Depends on D190014

Attachment #9355102 - Attachment description: WIP: Bug 1854550 - pt 4. PHC doesn't use the malloc table to call jemalloc → Bug 1854550 - pt 4. PHC doesn't use the malloc table to call jemalloc r=glandium
Attachment #9356538 - Attachment description: WIP: Bug 1854550 - pt 5. Remove templating around allocation classes → Bug 1854550 - pt 5. Remove templating around allocation classes r=glandium

Depends on D190417

THis needs to move out so that the state can be accessed before gMut is
created.

Depends on D190419

We need to track if PHC failed to initialise. We can add a disabled state
to PHCState for that.

Depends on D190420

Depends on D190422

Attachment #9357326 - Attachment description: WIP: Bug 1854550 - pt 6. Move AlignedAllocator into a header → Bug 1854550 - pt 6. Move AlignedAllocator into a header r=glandium
Attachment #9357330 - Attachment description: WIP: Bug 1854550 - pt 7. AlignedAllocator takes a class as an argument → Bug 1854550 - pt 7. AlignedAllocator takes a class as an argument r=glandium
Attachment #9357330 - Attachment is obsolete: true
Attachment #9356537 - Attachment description: Bug 1854550 - pt 3. Define kAllocJunk once for jemalloc and PHC r=glandium → Bug 1854550 - pt 3. Define kAlloc{Junk,Poison} once for jemalloc and PHC r=glandium
Attachment #9357331 - Attachment description: WIP: Bug 1854550 - pt 8. Move mPhcState out of the GMut class → Bug 1854550 - pt 7. Move mPhcState out of the GMut class r=glandium
Attachment #9357332 - Attachment description: WIP: Bug 1854550 - pt 9. Add a disabled state to PHCState → Bug 1854550 - pt 8. Add a disabled state to PHCState r=glandium
Attachment #9357333 - Attachment description: WIP: Bug 1854550 - pt 10. Call PHC directly rather than through replace malloc → Bug 1854550 - pt 9. Call PHC directly rather than through replace malloc r=glandium
Attachment #9357334 - Attachment description: WIP: Bug 1854550 - pt 11. Rename a variable → Bug 1854550 - pt 10. Rename a variable r=glandium

This really only works-around the problem by adding an extra unused argument
to the macro.

Depends on D191133

Attachment #9358771 - Attachment description: WIP: Bug 1854550 - pt 11. Move PHC interface from the bridge to PHC.h → Bug 1854550 - pt 11. Move PHC interface from the bridge to PHC.h r=glandium
Attachment #9358798 - Attachment description: WIP: Bug 1854550 - pt 13. PHC no-longer requires replace-malloc → Bug 1854550 - pt 13. PHC no-longer requires replace-malloc r=glandium
Attachment #9358772 - Attachment description: Bug 1854550 - pt 12. Fix a compile error when PHC_LOGGING is 1 r=glandium → Bug 1854550 - pt 12. Allow LOG() with zero extra arguments r=glandium
Attachment #9357331 - Attachment is obsolete: true
Attachment #9357332 - Attachment is obsolete: true
Attachment #9357333 - Attachment description: Bug 1854550 - pt 9. Call PHC directly rather than through replace malloc r=glandium → Bug 1854550 - pt 7. Call PHC directly rather than through replace malloc r=glandium
Attachment #9357334 - Attachment description: Bug 1854550 - pt 10. Rename a variable r=glandium → Bug 1854550 - pt 8. Rename a variable r=glandium
Attachment #9358771 - Attachment description: Bug 1854550 - pt 11. Move PHC interface from the bridge to PHC.h r=glandium → Bug 1854550 - pt 9. Move PHC interface from the bridge to PHC.h r=glandium
Attachment #9358772 - Attachment description: Bug 1854550 - pt 12. Allow LOG() with zero extra arguments r=glandium → Bug 1854550 - pt 10. Allow LOG() with zero extra arguments r=glandium
Attachment #9358798 - Attachment description: Bug 1854550 - pt 13. PHC no-longer requires replace-malloc r=glandium → Bug 1854550 - pt 11. PHC no-longer requires replace-malloc r=glandium
Attachment #9358894 - Attachment description: Bug 1854550 - pt 14. Allow inlining between mozjemalloc and PHC r=glandium → Bug 1854550 - pt 12. Allow inlining between mozjemalloc and PHC r=glandium
Pushed by pbone@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9e6e82ff6969
pt 1. Fix a comment r=glandium
https://hg.mozilla.org/integration/autoland/rev/498c79b32f88
pt 2. Move PHC into memory/build r=glandium
https://hg.mozilla.org/integration/autoland/rev/fa9f1571404e
pt 3. Define kAlloc{Junk,Poison} once for jemalloc and PHC r=glandium
https://hg.mozilla.org/integration/autoland/rev/587d6c02f925
pt 4. PHC doesn't use the malloc table to call jemalloc r=glandium
https://hg.mozilla.org/integration/autoland/rev/44c6b31c9fc0
pt 5. Remove templating around allocation classes r=glandium
https://hg.mozilla.org/integration/autoland/rev/f79fd63f0906
pt 6. Move AlignedAllocator into a header r=glandium
https://hg.mozilla.org/integration/autoland/rev/57c3eb49bb84
pt 7. Call PHC directly rather than through replace malloc r=glandium
https://hg.mozilla.org/integration/autoland/rev/e656c6464f14
pt 8. Rename a variable r=glandium
https://hg.mozilla.org/integration/autoland/rev/4418d8a41f12
pt 9. Move PHC interface from the bridge to PHC.h r=glandium
https://hg.mozilla.org/integration/autoland/rev/c3d700756320
pt 10. Allow LOG() with zero extra arguments r=glandium
https://hg.mozilla.org/integration/autoland/rev/34deef809a36
pt 11. PHC no-longer requires replace-malloc r=glandium
https://hg.mozilla.org/integration/autoland/rev/294e392145f1
pt 12. Allow inlining between mozjemalloc and PHC r=glandium
Regressions: 1872320
Regressions: 1884996
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: