summaryrefslogtreecommitdiff
path: root/erts/include
diff options
context:
space:
mode:
authorJohn Högberg <john@erlang.org>2019-10-03 10:06:40 +0200
committerJohn Högberg <john@erlang.org>2019-10-10 12:52:24 +0200
commitfab87b2879478aab37a01b4eadf9a83c461f437e (patch)
tree65c11625453f632680ab4fc658ddfafea49c9d04 /erts/include
parentc46f6b36b2f68f1c616406c0e6b1730dcff2b835 (diff)
downloaderlang-fab87b2879478aab37a01b4eadf9a83c461f437e.tar.gz
erts: Honor CPU quotas when deciding number of online schedulers
Using more cores than we have quota for is likely to hurt performance as any busy-waiting we might do (waiting for new jobs to arrive in a queue, waiting for a lock, etc) will burn the quota without doing useful work, leaving us with fewer resources to work with. This is especially bad when the +sbwt option has been used to increase the wait time. This commit checks our current CPU quota (if possible) and tries to limit the number of online schedulers accordingly on startup. The schedulers can be brought online later on, or overridden with the `+S` option.
Diffstat (limited to 'erts/include')
-rw-r--r--erts/include/internal/erl_misc_utils.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/erts/include/internal/erl_misc_utils.h b/erts/include/internal/erl_misc_utils.h
index 55566ddf74..59933ade4b 100644
--- a/erts/include/internal/erl_misc_utils.h
+++ b/erts/include/internal/erl_misc_utils.h
@@ -39,6 +39,7 @@ int erts_cpu_info_update(erts_cpu_info_t *cpuinfo);
int erts_get_cpu_configured(erts_cpu_info_t *cpuinfo);
int erts_get_cpu_online(erts_cpu_info_t *cpuinfo);
int erts_get_cpu_available(erts_cpu_info_t *cpuinfo);
+int erts_get_cpu_quota(erts_cpu_info_t *cpuinfo);
char *erts_get_unbind_from_cpu_str(erts_cpu_info_t *cpuinfo);
int erts_get_available_cpu(erts_cpu_info_t *cpuinfo, int no);
int erts_get_cpu_topology_size(erts_cpu_info_t *cpuinfo);