aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2013-11-28 14:53:36 +0100
committerLukas Larsson <[email protected]>2013-11-28 14:53:36 +0100
commita30d07c660b3d2269484fcafb493daf670a21a72 (patch)
tree276727cbcecba762ac0f2e3ff6dd8f5976d7b6e2 /erts/emulator
parent67837031b8e23031506dda9ed02a53650528da35 (diff)
parent172ac461d7055b655a9b5c22c1d95a140624945f (diff)
downloadotp-a30d07c660b3d2269484fcafb493daf670a21a72.tar.gz
otp-a30d07c660b3d2269484fcafb493daf670a21a72.tar.bz2
otp-a30d07c660b3d2269484fcafb493daf670a21a72.zip
Merge branch 'maint'
* maint: Improve error info when main carrier creation fails
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_alloc_util.c11
-rw-r--r--erts/emulator/test/alloc_SUITE.erl7
2 files changed, 15 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_alloc_util.c b/erts/emulator/beam/erl_alloc_util.c
index 441133a464..3914537d0d 100644
--- a/erts/emulator/beam/erl_alloc_util.c
+++ b/erts/emulator/beam/erl_alloc_util.c
@@ -5610,8 +5610,15 @@ erts_alcu_start(Allctr_t *allctr, AllctrInit_t *init)
| CFLG_FORCE_SYS_ALLOC
#endif
| CFLG_MAIN_CARRIER);
- if (!blk)
- goto error;
+ if (!blk) {
+#ifdef USE_THREADS
+ if (allctr->thread_safe)
+ erts_mtx_destroy(&allctr->mutex);
+#endif
+ erl_exit(ERTS_ABORT_EXIT,
+ "Failed to create main carrier for %salloc\n",
+ init->name_prefix);
+ }
(*allctr->link_free_block)(allctr, blk);
diff --git a/erts/emulator/test/alloc_SUITE.erl b/erts/emulator/test/alloc_SUITE.erl
index cd2d043f7e..35c44c229a 100644
--- a/erts/emulator/test/alloc_SUITE.erl
+++ b/erts/emulator/test/alloc_SUITE.erl
@@ -127,7 +127,12 @@ erts_mmap(Config) when is_list(Config) ->
erts_mmap_do(Config, SCO, SCRPM, SCRFSD) ->
- SCS = 100, % Mb
+ %% We use the number of schedulers + 1 * approx main carriers size
+ %% to calculate how large the super carrier has to be
+ %% and then use a minimum of 100 for systems with a low amount of
+ %% schedulers
+ Schldr = erlang:system_info(schedulers_online)+1,
+ SCS = max(round((262144 * 6 + 3 * 1048576) * Schldr / 1024 / 1024),100),
O1 = "+MMscs" ++ integer_to_list(SCS)
++ " +MMsco" ++ atom_to_list(SCO)
++ " +MMscrpm" ++ atom_to_list(SCRPM),