Bug 22340 – totalCPUs may not return accurate number of CPUs

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2021-09-28T10:25:38Z
Last change time
2021-09-28T16:21:10Z
Keywords
pull
Assigned to
No Owner
Creator
RazvanN

Comments

Comment #0 by razvan.nitu1305 — 2021-09-28T10:25:38Z
Taken from Ruby source code [1]: "man page says CPU_ALLOC takes number of cpus. But it is not accurate explanation. sched_getaffinity() returns EINVAL if cpuset bitmap is smaller than kernel internal bitmap. That said, sched_getaffinity() can fail when a kernel have sparse bitmap even if cpuset bitmap is larger than number of cpus." [1] https://github.com/ruby/ruby/commit/7d9e04de496915dd9e4544ee18b1a0026dc79242#diff-52a01c201f25446fa66b7489e2c0d573468fdbffad4557fd5f7003936a834229R923
Comment #1 by dlang-bot — 2021-09-28T10:32:29Z
@kubo39 updated dlang/phobos pull request #7444 "totalCPUs returns accurate number of CPUs when >= 1024 on Linux" fixing this issue: - Fix Issue 22340 - totalCPUs may not return accurate number of CPUs https://github.com/dlang/phobos/pull/7444
Comment #2 by dlang-bot — 2021-09-28T12:14:04Z
dlang/phobos pull request #7444 "Fix Issue 22340 - totalCPUs may not return accurate number of CPUs " was merged into master: - 23fa7b144a6f59df52e608c10a94fbc49e9483b3 by Hiroki Noda: Fix Issue 22340 - totalCPUs may not return accurate number of CPUs bugzilla url: https://issues.dlang.org/show_bug.cgi?id=22340 https://github.com/dlang/phobos/pull/7444
Comment #3 by dlang-bot — 2021-09-28T16:21:10Z
dlang/phobos pull request #6858 "add -preview=fieldwise to build" was merged into master: - 563c378acb4ac30e5e0aa1b208f4641835a3f4a3 by RazvanN7: Fix Issue 22340 - totalCPUs may not return accurate number of CPUs https://github.com/dlang/phobos/pull/6858