diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2024-05-20 15:01:31 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-05-22 11:58:56 -0700 |
commit | 2e7e9205beb5a745f91d0d0ce772c7b447c3aba8 (patch) | |
tree | ea7bc35ab4c2fddb216a251342cf04d28fc94767 /commit.c | |
parent | 45db5ed3b2f9f1c4768633f3d691bbe1305cf9ca (diff) |
chainlint.pl: latch CPU count directly reported by /proc/cpuinfo
On Linux, ncores() computes the number of CPUs by counting the
"processor" or "CPU" lines emitted by /proc/cpuinfo. However, on some
platforms, /proc/cpuinfo does not enumerate the CPUs at all, but
instead merely mentions the total number of CPUs. In such cases, pluck
the CPU count directly from the /proc/cpuinfo line which reports the
number of active CPUs. (In particular, check for "cpus active: NN" and
"ncpus active: NN" since both variants have been seen in the
wild[1,2].)
[1]: https://lore.kernel.org/git/503a99f3511559722a3eeef15d31027dfe617fa1.camel@physik.fu-berlin.de/
[2]: https://lore.kernel.org/git/7acbd5c6c68bd7ba020e2d1cc457a8954fd6edf4.camel@physik.fu-berlin.de/
Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions