Commit Graph
717 Commits
Author SHA1 Message Date
Iris Hsiao 37f5caf99a Backed out changeset 24bea8bde57d (bug 1343432) for build bustage 2017-03-02 11:23:28 +08:00
Ryan VanderMeulen 25058b30c8 Bug 1343432 - Update jemalloc 4 to version 4.5.0. r=glandium 2017-03-01 21:06:24 -05:00
Eric Rahm b90c90aec2 Bug 1341621 - Avoid deadlocks in DMD when forking. r=njn
In order to avoid the possibility of a deadlock if the DMD state lock is
currently acquired when forking a |pthread_atfork| hook is added to wait for
and acquire the lock prior to forking, then release it after forking.
2017-02-23 17:47:02 -08:00
David Major 9b18594311 Bug 419470: Re-enable PGO for Linux mozjemalloc. r=glandium
It only took nine years.

MozReview-Commit-ID: 2zsCBMTJ6O1
2017-02-22 09:46:06 +13:00
Emanuel Hoogeveen 518860841b Bug 1338574 - Part 8: Use MOZ_ASSERT and MOZ_CRASH_UNSAFE_OOL in mozjemalloc. r=glandium 2017-02-21 18:02:07 +01:00
Emanuel Hoogeveen ba1459c85c Bug 1338574 - Part 1: Add MOZ_CRASH_UNSAFE_OOL and MOZ_CRASH_UNSAFE_PRINTF to crash with a runtime generated explanation string. r=froydnj 2017-02-21 18:01:41 +01:00
Wes Kocher b91739bde1 Merge inbound to m-c a=merge
MozReview-Commit-ID: IKI0zVtF1n9
2017-02-15 16:18:13 -08:00
Emanuel Hoogeveen 8738d9d6d4 Bug 1339441 - Take the arena lock earlier in arena_dalloc(). r=glandium 2017-02-15 09:48:00 -05:00
Sylvestre Ledru c86cd0927f Bug 1338086 - Remove useless else blocks in order to reduce complexity in memory/ r=njn
MozReview-Commit-ID: G7jBKlDHshQ
2017-02-09 11:24:39 +01:00
Benjamin Smedberg 3a243797b4 Bug 1333826 - Remove SDK_FILES, SDK_LIBRARY, and related is_sdk support in the build goop, r=mshal
MozReview-Commit-ID: 52vPyDXdFte
2017-01-30 11:24:10 -05:00
Dimitry Andric 1dc65d1589 Bug 1329520 - Fix "memory/mozalloc/throw_gcc.h:35:1: note: declaration missing '[[noreturn]]' (libc++ 4.0)" r=nfroyd 2017-01-27 13:55:00 +01:00
Mike Hommey 51eeddedc2 Bug 1332508 - Reinitialize allocator mutexes in fork() child processes. r=njn
Adapted from
https://github.com/jemalloc/jemalloc/commit/4e2e3dd9cf19ed5991938a708a8b50611aa5bbf8
and
https://github.com/jemalloc/jemalloc/commit/d9f7b2a4307f7ff9f7a139b33d366d44e8a8b83d

As per the latter commit, it would seem unlocking, in fork() child
processes, mutexes that were locked in the parent process is not really
well supported on OSX 10.12. The addition of the zone_reinit_lock
function in 10.12 supports this idea.
2017-01-20 10:06:41 +09:00
Mike Hommey 285aae9581 Bug 1286613 - Update jemalloc 4 to c6943ac. r=njn
This picks the same changes as the ones we just did to
memory/build/zone.c, plus a oneliner for sparc64.
2017-01-18 15:47:53 +09:00
Mike Hommey 9f0bee033c Bug 1286613 - Add dummy implementations for most remaining OSX zone allocator functions. r=njn
Some system libraries are using malloc_default_zone() and then using
some of the malloc_zone_* API. Under normal conditions, those functions
check the malloc_zone_t/malloc_introspection_t struct for the values
that are allowed to be NULL, so that a NULL deref doesn't happen.

As of OSX 10.12, malloc_default_zone() doesn't return the actual default
zone anymore, but returns a fake, wrapper zone. The wrapper zone defines
all the possible functions in the malloc_zone_t/malloc_introspection_t
struct (almost), and calls the function from the registered default zone
(jemalloc in our case) on its own. Without checking whether the pointers
are NULL.

This means that a system library that calls e.g.
malloc_zone_batch_malloc(malloc_default_zone(), ...) ends up trying to
call jemalloc_zone.batch_malloc, which is NULL, and crash follows.

So as of OSX 10.12, the default zone is required to have all the
functions available (really, the same as the wrapper zone), even if they
do nothing.

This is arguably a bug in libsystem_malloc in OSX 10.12, but jemalloc
still needs to work in that case.

[Adapted from
https://github.com/jemalloc/jemalloc/commit/c6943acb3c56d1b3d1e82dd43b3fcfeae7771990]
2017-01-18 14:35:11 +09:00
Mike Hommey c6cb3ef086 Bug 1286613 - Don't rely on OSX SDK malloc/malloc.h for malloc_zone struct definitions. r=njn
The SDK jemalloc is built against might be not be the latest for various
reasons, but the resulting binary ought to work on newer versions of
OSX.

In order to ensure this, we need the fullest definitions possible, so
copy what we need from the latest version of malloc/malloc.h available
on opensource.apple.com.

[Adapted from
https://github.com/jemalloc/jemalloc/commit/c68bb4179312665e22d375aecf9f4306607c7c1a]
2017-01-18 13:50:35 +09:00
Mike Hommey 7a3f93d348 Bug 1286613 - Use the same zone allocator implementation as replace-malloc for mozjemalloc. r=njn
We have been using a different zone allocator between mozjemalloc and
replace-malloc for a long time. Jemalloc 4 uses the same as
replace-malloc, albeit as part of the jemalloc upstream code base.

We've been bitten many times in the past with Apple changes breaking the
zone allocator, and each time we've had to make changes to the three
instances, although two of them are similar and the changes there are
straightforward.

It also turns out that the way the mozjemalloc zone allocator is set up,
when a new version of OSX appears with a new version of the system zone
allocator, Firefox ends up using the system allocator, because the zone
allocator version is not supported.

So, we use the same zone allocator for both replace-malloc and
mozjemalloc, making everything on par with jemalloc 4.
2017-01-18 11:45:45 +09:00
Mike Hommey 67893fa763 Bug 1286613 - Move replace-malloc zone allocator to a separate file. r=njn
The intent here is to reuse the zone allocator for mozjemalloc, to avoid
all the shortcomings of mozjemalloc using a different one. This change
only moves the replace-malloc zone allocator out of replace-malloc.c, to
make changes for mozjemalloc integration clearer.
2017-01-18 11:39:29 +09:00
Mike Hommey a1e25cd0ab Bug 1286613 - Properly call mozjemalloc pre/post fork hooks on OSX when replace-malloc is enabled. r=njn
Somehow, we never called those hooks when replace-malloc is enabled. I'd
expect this to cause random deadlocks when forking, and I'm surprised
this hasn't surfaced. Maybe it actually causes some intermittent oranges
on automation, who knows.

This also brings consistency with what is done for jemalloc 4, and with
the mozjemalloc implementation, too, that we're going to replace with
this one in a subsequent changeset.
2017-01-19 09:37:22 +09:00
John Paul Adrian Glaubitz 0928c08f07 Bug 1275204 - mozjemalloc: Use the JS arm64 allocator on Linux/sparc64. r=glandium 2017-01-11 16:09:39 +09:00
John Paul Adrian Glaubitz 7e87363436 Bug 1275204 - mozjemalloc: Use better pre-processor defines for sparc64. r=glandium 2017-01-11 16:05:53 +09:00
Ryan VanderMeulen 134af6dfbb Bug 1200951 - Use the same poison patterns for jemalloc4 as mozjemalloc. r=glandium 2017-01-10 22:50:36 -05:00
Ryan VanderMeulen f94b8a1d4f Bug 1322027 - Update jemalloc 4 to version 4.4.0. r=glandium 2017-01-10 22:50:36 -05:00
Chris Peterson d18c7ac5bc Bug 1142403 - Part 3: jemalloc4 no longer requires ctl.c to be built in non-unified mode in debug builds. r=glandium 2016-12-22 18:54:59 -08:00
Mike Hommey 5cf7606594 Bug 1142403 - Part 1: Don't build jemalloc4 with unified sources when built with --enable-debug. r=mshal
When built with --enable-debug, jemalloc4 makes headers define functions that
are normally inlined, and that prevents unified sources from working.
2015-08-12 16:04:53 +09:00
Mike Hommey 605fdf3ce8 Bug 1321093 - Avoid logalloc-replay make check failure when libstdc++ allocates memory in some static initializer. r=njn 2016-11-30 07:22:20 +09:00
Mike Hommey cef534de1e Bug 1311039 - Properly detect the default malloc zone on OSX 10.12. r=njn 2016-11-03 10:02:06 +09:00
Emanuel Hoogeveen 616447c625 Bug 1315939 - Use FINAL_LIBRARY = 'memory' in jemalloc and mozjemalloc. r=glandium 2016-11-10 06:57:00 -05:00
Eric Rahm 41c80ef7d6 Bug 1313485 - Convert XPCOM test TestJemalloc to a gtest. r=njn
MozReview-Commit-ID: 5yzn8o33Ne5
2016-11-09 10:24:22 -08:00
Ryan VanderMeulen 8dd11a920e Bug 1277704 - Update jemalloc 4 to version 4.3.1. r=glandium 2016-07-12 10:37:04 -04:00
Emanuel Hoogeveen 2ab5f433fd Bug 1309573 - Part 2: Define MOZ_HAS_MOZGLUE in various places so that the crash reason gets used. r=glandium 2016-11-08 03:53:00 -05:00
Sebastian Hengst f3b9fd3b49 Backed out changeset 1b545e55e42a (bug 1313485) for bustage. r=backout 2016-11-07 23:46:09 +01:00
Eric Rahm f1c4acfec0 Bug 1313485 - Convert XPCOM test TestJemalloc to a gtest. r=njn
MozReview-Commit-ID: 5yzn8o33Ne5
2016-11-07 14:26:25 -08:00
Mike Hommey e02f259e7a Bug 1303232 - Use per-process reduced thread-ids when munging logalloc logs. r=njn
Bug 1300948 added thread-ids to logalloc logs, and logalloc_munge.py was
munging them all as if they were all under the same namespace. But when
filtering munged logs to only contain logs from a given process,
thread-ids then don't necessarily start from 1, which would be the
desired outcome.

So use a different pool of thread-ids for each process.
2016-09-20 13:44:27 +09:00
Mike Hommey 478295f55b Bug 1300974 - Work around race condition leading to deadlock on fork when enabling LogAlloc. r=njn 2016-09-08 07:56:02 +09:00
Mike Hommey 5e0fc294de Bug 1300948 - Add thread identifier to LogAlloc output. r=njn 2016-09-08 07:55:03 +09:00
Cameron McCormack aa137c3dd8 Bug 1291356 - Enable multiple jemalloc arenas for MOZ_STYLO builds. r=me 2016-08-26 20:21:48 +09:00
Wes Kocher 077f9b1574 Merge m-c to autoland, a=merge 2016-08-25 17:15:05 -07:00
Emanuel Hoogeveen 363f9560d9 Bug 1294732 - Back out all of bug 1271165 as it has served its purpose. r=glandium 2016-08-23 08:45:00 -04:00
Andrew McCreight f3d273c448 Bug 1295695 - Add maybe_pod_* methods to InfallibleAllocPolicy. r=glandium
Bug 1207519 added maybe_pod_* methods to the allocation policy
classes, but did not add them to InfallibleAllocPolicy.

I think the idea of these methods is that the callers are explicitly
opting into fallible behavior, so they will deal with any errors that
occur. For instance, in js::HashTable, this is used to try to shrink
the hash table when there are a lot of unused entries. If the shrink
fails, it just continues to use the existing block of memory.

However, having fallible methods in a supposedly infallible class is
weird, so for now, just use the infallible version.

MozReview-Commit-ID: 97D66Z4oLfl
2016-08-16 11:09:05 -07:00
Ryan VanderMeulen 65e0550627 Merge m-c to inbound. a=merge 2016-08-24 09:09:05 -04:00
Andrew McCreight 6a2f9f9e4e Bug 1295688 - InfallibleAllocPolicy should crash on overflow. r=glandium
Code that uses InfallibleAllocPolicy presumably wants for operations
to always succeed. However, Vector and HashTable can end up detecting
that growing the data structure will fail due to integer overflow, and
then will call reportAllocOverflow() and fail. I think these cases
should crash.

In addition, pod_malloc and pod_realloc should crash rather than
returning NULL when they detect overflow.

This calls mozalloc_abort rather than MOZ_CRASH directly to avoid
circular #includes, because Assertions.h includes nsTraceRefcnt.h
which includes nscore.h which includes mozalloc.h.

MozReview-Commit-ID: 1g99BXLceQI
2016-08-16 10:56:14 -07:00
Kan-Ru Chen a9b19d0584 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
The patch is generated from following command:

  rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,

MozReview-Commit-ID: AtLcWApZfES
2016-08-24 14:47:04 +08:00
Emanuel Hoogeveen fb486d1019 Bug 1271165 - Part 6: Change the new functions to MFBT_API to export them on OSX. r=jandem 2016-08-16 07:12:00 -04:00
Emanuel Hoogeveen c25a02ae46 Bug 1271165 - Part 4: Enable the new functionality in mozjemalloc. r=ehoogeveen 2016-08-12 07:38:00 -04:00
Emanuel Hoogeveen 97635674b1 Bug 1271165 - Part 2: Hook the new functions up and provide dummy implementations where needed. r=ehoogeveen 2016-08-12 07:37:00 -04:00
Emanuel Hoogeveen dfc445c086 Bug 1271165 - Part 1: Add protected allocation functions and supporting infrastructure to mozjemalloc. r=ehoogeveen 2016-08-12 07:36:00 -04:00
Emanuel Hoogeveen 68a1962fdb Bug 1271165 - Part 0: Strip trailing blanks from mozjemalloc. r=ehoogeveen 2016-08-12 07:36:00 -04:00
Alexandre Lissy b2834a3543 Bug 1284674 - Remove NUWA r=cyu
MozReview-Commit-ID: GyMRNzOBKw6
2016-08-02 14:54:00 +02:00
Chris Peterson 3e31089ef9 Bug 1290645 - Remove VS2013 workarounds in memory/. r=glandium 2016-07-28 11:46:30 -07:00
Tom Tromey 1b5a2bdb96 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx
2016-07-14 10:16:42 -06:00