aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2017-10-23 15:55:03 +0200
committerLukas Larsson <[email protected]>2017-10-23 15:55:06 +0200
commit73094884d8113b7290080c6426957d2bf5180ec8 (patch)
tree151baa01323d2c3458d643ead44e5c0550fd814e
parent919ef5de2858e606d4a9be3e0e995b0802c76e33 (diff)
downloadotp-73094884d8113b7290080c6426957d2bf5180ec8.tar.gz
otp-73094884d8113b7290080c6426957d2bf5180ec8.tar.bz2
otp-73094884d8113b7290080c6426957d2bf5180ec8.zip
erts: Fix so that bind correct schedulers
When the cpu ids and scheduler ids don't match, the end schedulers could end up not being bound when they should be. example: > taskset -c 1-3 erl +S 4 +sbts > erlang:system_info(scheduler_bindings). {1,2,3,unbound} This fix makes it so that all cores are used to bind schedulers.
-rw-r--r--erts/emulator/beam/erl_cpu_topology.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_cpu_topology.c b/erts/emulator/beam/erl_cpu_topology.c
index f8b2fa744f..dfe49ce382 100644
--- a/erts/emulator/beam/erl_cpu_topology.c
+++ b/erts/emulator/beam/erl_cpu_topology.c
@@ -608,7 +608,7 @@ write_schedulers_bind_change(erts_cpu_topology_t *cpudata, int size)
cpu_bind_order_sort(cpudata, size, cpu_bind_order, 1);
- for (cpu_ix = 0; cpu_ix < size && cpu_ix < erts_no_schedulers; cpu_ix++)
+ for (cpu_ix = 0; cpu_ix < size && s_ix <= erts_no_schedulers; cpu_ix++)
if (erts_is_cpu_available(cpuinfo, cpudata[cpu_ix].logical))
scheduler2cpu_map[s_ix++].bind_id = cpudata[cpu_ix].logical;
}