From 73094884d8113b7290080c6426957d2bf5180ec8 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 23 Oct 2017 15:55:03 +0200 Subject: 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. --- erts/emulator/beam/erl_cpu_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/emulator/beam/erl_cpu_topology.c') 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; } -- cgit v1.2.3