Summary: | Search concurrency doesn't respect CPU affinity | ||
---|---|---|---|
Product: | elfutils | Reporter: | Ross Burton <ross> |
Component: | debuginfod | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | elfutils-devel, fche |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Ross Burton
2023-01-09 17:38:22 UTC
> number of cores available to it (sched_getaffinity()).
Do you happen to be aware of a c++y front-end to this, which we could
use instead of std::thread::hardware_concurrency() ?
No, but the C isn't that difficult: #define _GNU_SOURCE #include <sched.h> int ret, count; cpu_set_t mask; CPU_ZERO(&mask); ret = sched_getaffinity(0, sizeof(mask), &mask); // if non-zero, errno is set count = CPU_COUNT(&mask); please check out commit 7399e3bd7eb72d045 on elfutils.git for a test patch Pushed to master as dcb40f9caa7ca30 Author: Frank Ch. Eigler <fche@redhat.com> Date: Tue Jan 10 17:59:35 2023 -0500 debuginfod PR29975 & PR29976: decrease default concurrency ... based on rlimit (rlimig -n NUM) ... based on cpu-affinity (taskset -c A,B,C,D ...) Signed-off-by: Frank Ch. Eigler <fche@redhat.com> |