Commit Graph

1773 Commits

Author SHA1 Message Date
Alexandru Marc
83543f20f2 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille
c7a369b29a Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 07:38:30 +00:00
Alexandre Lissy
faa7b1b2a7 Bug 1925181 - Properly set small alloc randomization on Android content processes as well r=jld
Differential Revision: https://phabricator.services.mozilla.com/D226135
2024-10-21 06:05:44 +00:00
Alexandre Lissy
b6c10eb16a Bug 1917844 - Expose ForkServer-specific mozjemalloc reinit r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D220578
2024-10-21 06:05:43 +00:00
Alexandre Lissy
b027c28f3f Bug 1917844 - Assert correct jemalloc randomization state on Content and non Content processes r=jld,glandium
Differential Revision: https://phabricator.services.mozilla.com/D221971
2024-10-21 06:05:43 +00:00
Butkovits Atila
156b2012dc Backed out 8 changesets (bug 1918596, bug 1917575, bug 1874689, bug 1925181, bug 1917844, bug 1925274, bug 1915152) for causing failures at Sandbox.cpp. CLOSED TREE
Backed out changeset ce2138248319 (bug 1874689)
Backed out changeset fbe9fbb6ae72 (bug 1925181)
Backed out changeset c9896c8962cb (bug 1925274)
Backed out changeset 6eddbad5949c (bug 1918596)
Backed out changeset b9bf86fa1c74 (bug 1917844)
Backed out changeset 1d4cd83d1a39 (bug 1917844)
Backed out changeset 264a5140fbcb (bug 1917575)
Backed out changeset 87b8512c67c9 (bug 1915152)
2024-10-19 23:27:56 +03:00
Alexandre Lissy
d5498aec0d Bug 1925181 - Properly set small alloc randomization on Android content processes as well r=jld
Differential Revision: https://phabricator.services.mozilla.com/D226135
2024-10-19 08:55:34 +00:00
Alexandre Lissy
de6bf60546 Bug 1917844 - Expose ForkServer-specific mozjemalloc reinit r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D220578
2024-10-19 08:55:33 +00:00
Alexandre Lissy
257033c076 Bug 1917844 - Assert correct jemalloc randomization state on Content and non Content processes r=jld,glandium
Differential Revision: https://phabricator.services.mozilla.com/D221971
2024-10-19 08:55:32 +00:00
Adi
43e200afe1 Backed out 6 changesets (bug 1918596, bug 1915152, bug 1917844, bug 1917575, bug 1874689) for causing valgrind bustages. CLOSED TREE
Backed out changeset b7f977ce6ea0 (bug 1874689)
Backed out changeset e9ccbb43f903 (bug 1918596)
Backed out changeset 39bf07957c07 (bug 1917844)
Backed out changeset 61d1c38cc516 (bug 1917844)
Backed out changeset 2a9a2bca99ce (bug 1917575)
Backed out changeset dab1b77688b2 (bug 1915152)
2024-10-17 14:56:41 +03:00
Alexandre Lissy
5e9c091dc4 Bug 1917844 - Expose ForkServer-specific mozjemalloc reinit r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D220578
2024-10-17 06:29:54 +00:00
Alexandre Lissy
a0ab183c01 Bug 1917844 - Assert correct jemalloc randomization state on Content and non Content processes r=jld,glandium
Differential Revision: https://phabricator.services.mozilla.com/D221971
2024-10-17 06:29:54 +00:00
Cosmin Sabou
1bc4690f6a Backed out 6 changesets (bug 1917575, bug 1917844, bug 1874689, bug 1918596, bug 1915152) for causing ContentChild crashes. CLOSED TREE
Backed out changeset d6dc6d8085b5 (bug 1874689)
Backed out changeset 8c3916995be2 (bug 1918596)
Backed out changeset f77e369d1e0f (bug 1917844)
Backed out changeset 3bee9479316a (bug 1917844)
Backed out changeset 5c72e4a84a2c (bug 1917575)
Backed out changeset af3350e58b0a (bug 1915152)
2024-10-17 00:51:07 +03:00
Alexandre Lissy
02557ac85e Bug 1917844 - Expose ForkServer-specific mozjemalloc reinit r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D220578
2024-10-16 20:10:55 +00:00
Alexandre Lissy
d14345b00e Bug 1917844 - Assert correct jemalloc randomization state on Content and non Content processes r=jld,glandium
Differential Revision: https://phabricator.services.mozilla.com/D221971
2024-10-16 20:10:55 +00:00
Tamas Szentpeteri
8be45dd280 Backed out changeset 4b1409597101 (bug 1920718) for causing bp bustages on rapl.cpp. 2024-10-08 23:27:18 +03:00
serge-sans-paille
069a97307f Bug 1920718 - Annotate all global variable with runtime initialization as MOZ_RUNINIT r=application-update-reviewers,media-playback-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,gfx-reviewers,aosmond,lina,nalexander,aabh
This annotation is only understood by our clang-tidy plugin. It has no
effect on regular compilation.

Differential Revision: https://phabricator.services.mozilla.com/D223341
2024-10-08 16:49:51 +00:00
Nicolas Silva
90db643e31 Bug 1915144 - Add an API to purge excess dirty pages. r=pbone
The intent is to use this after having temporarily increased the max dirty page threshold.
This API will be used off the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D220256
2024-09-19 11:08:47 +00:00
Butkovits Atila
b1ebbb2c5c Backed out 2 changesets (bug 1915144, bug 1915146) for causing bustages at WebRenderBridgeParent.cpp. CLOSED TREE
Backed out changeset 7439c2116e36 (bug 1915146)
Backed out changeset 2230a291fd2d (bug 1915144)
2024-09-18 16:06:09 +03:00
Nicolas Silva
a6a4fb3b3a Bug 1915144 - Add an API to purge excess dirty pages. r=pbone
The intent is to use this after having temporarily increased the max dirty page threshold.
This API will be used off the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D220256
2024-09-18 12:27:02 +00:00
serge-sans-paille
ee3ee0a1e7 Bug 1918392 - Use c99 flexible array member syntax in mozjemalloc r=glandium
Adjust memory size computations as the FAM field now takes 0 extra byte.

Differential Revision: https://phabricator.services.mozilla.com/D221966
2024-09-17 14:36:24 +00:00
Jens Stutte
a461f84fcb Bug 1915564 - Rework arena_t::mPRNG initalization to be more explicit about avoiding double initialization. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D220538
2024-09-11 20:40:48 +00:00
Sylvestre Ledru
45030f6970 Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,necko-reviewers,geckoview-reviewers,application-update-reviewers,media-playback-reviewers,devtools-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,migration-reviewers,padenot,mconley,nchevobbe,kershaw,gstoll,mstange,bytesized,m_kato
This new version of clang 17 also slightly changed the formatting.

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D215914
2024-07-17 11:15:31 +00:00
Paul Bone
bcf3e8d2b3 Bug 1899464 - Use a free list to allocate PHC blocks r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D215731
2024-07-09 01:51:43 +00:00
Paul Bone
e4a222169f Bug 1875768 - Call the appropriate postfork handler on MacOS r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D212231
2024-07-04 03:51:07 +00:00
Paul Bone
2f4dc23a27 Bug 1875768 - Clear mMainThreadId after a fork in the child r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D212230
2024-07-04 03:51:07 +00:00
Paul Bone
9e144f0786 Bug 1875768 - Run PostForkMainThread before iterating the arenas r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D212229
2024-07-04 03:51:07 +00:00
Paul Bone
6911793132 Bug 1875768 - Use pthread_equal in IsOnMainThread and MaybeMutex r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D212228
2024-07-04 03:51:06 +00:00
Andrew McCreight
68868f579a Bug 1904685 - Output the addresses in dmd.py, when present. r=pbone
With heap scan mode, the DMD log includes the address of every block.
This patch includes the addresses in the output, if they are present.
This is useful when no cycle collected objects are leaked.

Differential Revision: https://phabricator.services.mozilla.com/D214880
2024-06-26 23:25:15 +00:00
Iulian Moraru
6c7b88f2f5 Backed out changeset 55f412f509f8 (bug 1904685) for causing xpcshell failures on test_dmd.js. CLOSED TREE 2024-06-27 01:02:57 +03:00
Andrew McCreight
6848b826e0 Bug 1904685 - Output the addresses in dmd.py, when present. r=pbone
With heap scan mode, the DMD log includes the address of every block.
This patch includes the addresses in the output, if they are present.
This is useful when no cycle collected objects are leaked.

Differential Revision: https://phabricator.services.mozilla.com/D214880
2024-06-26 18:10:29 +00:00
Paul Bone
065f8db2ee Bug 1874022 - pt 14. Seperate arena and non-arena code paths in PHC r=glandium
The Arena ID is wrapped in a Maybe, the construction of Nothing() shows up
in profiles.  By testing the maybe we show the compiler that it can optimise
away the construction of Nothing when inlining this code.

Differential Revision: https://phabricator.services.mozilla.com/D207680
2024-06-26 02:06:42 +00:00
Paul Bone
29a4b0695d Bug 1874022 - pt 13. Inline the hot path for free r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D214778
2024-06-26 02:06:42 +00:00
Paul Bone
f35b220ed9 Bug 1874022 - pt 12. Inline the hot path from MaybePageAlloc r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D207678
2024-06-26 02:06:41 +00:00
Paul Bone
7c1ac112d0 Bug 1874022 - pt 11. Improve cache locality r=glandium
+ Move sNow into the PHC class and put it next to mMutex, they're
   frequently modified together.

 + Reorganise PHC fields to place frequently-updated-together fields
   together, and separate them from the seldom-updated fields.

 + The only static fields remaining are write-once.

Differential Revision: https://phabricator.services.mozilla.com/D210468
2024-06-26 02:06:41 +00:00
Paul Bone
064646e2bb Bug 1874022 - pt 10. maybe_init() uses a single memory access r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D207677
2024-06-26 02:06:40 +00:00
Paul Bone
9374059263 Bug 1874022 - pt 9. Reduce the cost of updating sAllocDelay r=glandium
This change optimises the PHC hot path by reducing updates to sAllocDelay
and sNow:
 * tlsAllocDelay has been created to create thread-local allocation delays,
   when they expire then the shared sAllocDelay is checked.
 * sNow is updated only when not executing the fast path.

This change also:
 * Previously the thread that saw sAllocDelay == 0 would be the one to make
   the allocation, the ReleaseAquire semantics ensured that exactly one
   thread would see this.  Now all threads that see sAllocDelay <= 0 will
   attempt a PHC allocation, this is later checked by atomically resetting
   sAllocDelay.
 * Removes the logic that checks if the delay has wrapped
   while PHC was disabled on the current thread.  This isn't needed anymore
   because we now make PHC allocations for all sAllocDelay < 0, assuming
   that threads are disabled for less than UINT32_MAX/2 allocations.
 * Moves ShouldMakeNewAllocations out of the hot-path.

Differential Revision: https://phabricator.services.mozilla.com/D206469
2024-06-26 02:06:39 +00:00
Paul Bone
12f59050ca Bug 1874022 - pt 8. Add a proof of lock argument to ResetRNG r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D210467
2024-06-26 02:06:39 +00:00
Paul Bone
e8e18ea583 Bug 1874022 - pt 7. Move the mutex to a member variable r=glandium
This patch co-locates mMutex with the data it protects and is accessed
together.  It was previously located with global write-once data and updates
to `sMutex` were caused cache misses for `sPHC`.

Making `mMutex` a member variable also makes sense conceptually.

Differential Revision: https://phabricator.services.mozilla.com/D210466
2024-06-26 02:06:39 +00:00
Paul Bone
2778c556e1 Bug 1874022 - pt 6. Rename the GConst structure and move gConst r=glandium
Rename this structure to PHCRegion and move its instance into PHC.

Differential Revision: https://phabricator.services.mozilla.com/D210465
2024-06-26 02:06:38 +00:00
Paul Bone
2194e7b0de Bug 1874022 - pt 5. Fix some outdated comments r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D210464
2024-06-26 02:06:38 +00:00
Paul Bone
1a8ed74a5b Bug 1874022 - pt 4. Rename the GMut structure and move gMut to a static member r=glandium
I know this and some of the other refactoring patches are going to make
things more verbose (eg PHC::sPHC-> prefixing everything).  I intend to
follow up later and move more of PHC's code into the PHC class which will
then reduce the need for those pointers and scopes.

Differential Revision: https://phabricator.services.mozilla.com/D210463
2024-06-26 02:06:37 +00:00
Paul Bone
9f2d458e61 Bug 1874022 - pt 3. Move sAllocDelay into GMut r=glandium
This and the refactoring changes to follow are moving more of PHC's data
into one class.  From within there we can group it by how its accessed and
control which data is nearby other data to control cache line sharing.

sAllocDelay is always initialised by the GMut() constructor.  It is later
re-initialised from SetState() but that could be after PHC is already
active.

Differential Revision: https://phabricator.services.mozilla.com/D206468
2024-06-26 02:06:37 +00:00
Paul Bone
ea6f3a98ad Bug 1874022 - pt 2. Move sNow into GMut r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D206467
2024-06-26 02:06:36 +00:00
Paul Bone
cec1e05f90 Bug 1874022 - pt 1. Remove the GTls structure r=glandium
Currently we have 3 structures containing mutable data seperated by their
lock-safe behaviour (locked, atomic and TLS). I'd prefer to associate
structures by what they mean. This patch moves the `tlsIsDisabled`
variable, the only one in `GTls` into `GMutable` and removes the `GTls`
class.

Differential Revision: https://phabricator.services.mozilla.com/D206466
2024-06-26 02:06:35 +00:00
Sandor Molnar
10e7fbf7a5 Backed out 4 changesets (bug 1875768) for causing cppunittest-1proc failures CLOSED TREE
Backed out changeset add6151e17ee (bug 1875768)
Backed out changeset 01fa7e793e87 (bug 1875768)
Backed out changeset 99f0bce25b22 (bug 1875768)
Backed out changeset f6847957c1cc (bug 1875768)
2024-06-07 08:18:50 +03:00
Paul Bone
4c3610fd24 Bug 1875768 - Call the appropriate postfork handler on MacOS r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D212231
2024-06-07 01:34:58 +00:00
Paul Bone
e56ae17ca5 Bug 1875768 - Clear mMainThreadId after a fork in the child r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D212230
2024-06-07 01:34:58 +00:00
Paul Bone
0d9bba0bc3 Bug 1875768 - Run PostForkMainThread before iterating the arenas r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D212229
2024-06-07 01:34:58 +00:00
Paul Bone
680843ba36 Bug 1875768 - Use pthread_equal in IsOnMainThread and MaybeMutex r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D212228
2024-06-07 01:34:57 +00:00