File 0857-Use-schedulers_online-when-creating-bound-processes.patch of Package erlang

From b4d2bfffdac00812dc31540e33afa8728fff3f46 Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Mon, 4 May 2020 11:41:43 +0200
Subject: [PATCH 2/2] Use schedulers_online when creating bound processes

If a process is bound to a suspended schedulers we get
into all sorts of problems as they will never run and thus
purge cannot complete.. etc etc.
---
 erts/emulator/test/alloc_SUITE.erl    | 2 +-
 erts/emulator/test/counters_SUITE.erl | 6 +++---
 erts/emulator/test/process_SUITE.erl  | 2 +-
 erts/emulator/test/receive_SUITE.erl  | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/erts/emulator/test/alloc_SUITE.erl b/erts/emulator/test/alloc_SUITE.erl
index 24677247a7..8288da9f61 100644
--- a/erts/emulator/test/alloc_SUITE.erl
+++ b/erts/emulator/test/alloc_SUITE.erl
@@ -370,7 +370,7 @@ many_shot(CaseName, I, Mem) ->
     Result1.
 
 concurrent(CaseName) ->
-    NSched = erlang:system_info(schedulers),
+    NSched = erlang:system_info(schedulers_online),
     Mem = (free_memory() * 3) div 4,
     PRs = lists:map(fun(I) -> spawn_opt(fun() ->
 						many_shot(CaseName, I,
diff --git a/erts/emulator/test/counters_SUITE.erl b/erts/emulator/test/counters_SUITE.erl
index b3f0358c1e..7ddb574b36 100644
--- a/erts/emulator/test/counters_SUITE.erl
+++ b/erts/emulator/test/counters_SUITE.erl
@@ -66,7 +66,7 @@ check_memory(atomics, Memory, Size) ->
     {_,true} = {Memory, Memory > Size*8},
     {_,true} = {Memory, Memory < Size*max_atomic_sz() + 100};
 check_memory(write_concurrency, Memory, Size) ->
-    NWords = erlang:system_info(schedulers) + 1,
+    NWords = erlang:system_info(schedulers_online) + 1,
     {_,true} = {Memory, Memory > NWords*Size*8},
     {_,true} = {Memory, Memory < NWords*(Size+7)*max_atomic_sz() + 100}.
 
@@ -130,7 +130,7 @@ limits_do(Ref) ->
 %% Verify that independent workers, using different counters
 %% within the same array, do not interfere with each other.
 indep(Config) when is_list(Config) ->
-    NScheds = erlang:system_info(schedulers),
+    NScheds = erlang:system_info(schedulers_online),
     Ref = counters:new(NScheds,[write_concurrency]),
     Rounds = 100,
     Papa = self(),
@@ -182,7 +182,7 @@ indep_subber(_Ref, _I, Val) ->
 write_concurrency(Config) when is_list(Config) ->
     rand:seed(exs1024s),
     io:format("*** SEED: ~p ***\n", [rand:export_seed()]),
-    NScheds = erlang:system_info(schedulers),
+    NScheds = erlang:system_info(schedulers_online),
     Size = 100,
     Ref = counters:new(Size,[write_concurrency]),
     Rounds = 1000,
diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl
index f36e00d3ce..95b219188d 100644
--- a/erts/emulator/test/process_SUITE.erl
+++ b/erts/emulator/test/process_SUITE.erl
@@ -1127,7 +1127,7 @@ process_info_status_handled_signal(Config) when is_list(Config) ->
 %% And a bug where process_info(reductions) on a process which was releasing its
 %% main lock during execution could result in negative reduction diffs.
 process_info_reductions(Config) when is_list(Config) ->
-    {S1, S2} = case erlang:system_info(schedulers) of
+    {S1, S2} = case erlang:system_info(schedulers_online) of
                    1 -> {1,1};
                    _ -> {1,2}
                end,
diff --git a/erts/emulator/test/receive_SUITE.erl b/erts/emulator/test/receive_SUITE.erl
index 339507c9d8..333ca6a02a 100644
--- a/erts/emulator/test/receive_SUITE.erl
+++ b/erts/emulator/test/receive_SUITE.erl
@@ -37,7 +37,7 @@ all() ->
      receive_opt_exception, receive_opt_recursion].
 
 init_per_testcase(receive_opt_deferred_save, Config) ->
-    case erlang:system_info(schedulers) of
+    case erlang:system_info(schedulers_online) of
         1 ->
             {skip, "Needs more schedulers to run"};
         _ ->
-- 
2.26.1

openSUSE Build Service is sponsored by