Bug 2325167 - coreutils: nproc ignores affinity mask on machines with more than 1024 CPUs
Summary: coreutils: nproc ignores affinity mask on machines with more than 1024 CPUs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 41
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Florian Weimer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-11-11 11:29 UTC by Florian Weimer
Modified: 2024-11-20 16:21 UTC (History)
10 users (show)

Fixed In Version: coreutils-9.4-9.fc40 coreutils-9.5-11.fc41 coreutils-9.5-11.fc42
Clone Of:
Environment:
Last Closed: 2024-11-14 07:59:25 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
coreutils-nproc-affinity.patch (1.19 KB, patch)
2024-11-11 11:30 UTC, Florian Weimer
no flags Details | Diff
coreutils-nproc-affinity.patch (1.63 KB, patch)
2024-11-11 13:32 UTC, Florian Weimer
no flags Details | Diff

Description Florian Weimer 2024-11-11 11:29:27 UTC
The nproc tool calls sched_getaffinity with a fixed number of 1024 CPUs. This always fails on machines that have more CPUs. As a result, the sysconf fallback is used, resulting in unexpected results. It is necessary to use the glibc 2.6 APIs and retry with increasing CPU set sizes.


Reproducible: Always

Comment 1 Florian Weimer 2024-11-11 11:30:18 UTC
Created attachment 2057010 [details]
coreutils-nproc-affinity.patch

Comment 2 Florian Weimer 2024-11-11 11:33:58 UTC
Real upstream for this is gnulib, lib/nproc.c is copied from there.

Comment 3 Florian Weimer 2024-11-11 12:12:23 UTC
Patch submitted upstream:

[PATCH] nproc: Use affinity mask even on systems with more than 1024 CPUs
<https://lists.gnu.org/archive/html/bug-gnulib/2024-11/msg00082.html>

Comment 4 Florian Weimer 2024-11-11 13:32:44 UTC
Created attachment 2057030 [details]
coreutils-nproc-affinity.patch

Comment 5 Pádraig Brady 2024-11-11 13:34:42 UTC
I'll sync this to the coreutils upstream repo and add a NEWS entry.
thanks

Comment 7 Fedora Update System 2024-11-13 09:07:36 UTC
FEDORA-2024-4b75866373 (coreutils-9.5-11.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-4b75866373

Comment 8 Fedora Update System 2024-11-13 10:20:29 UTC
FEDORA-2024-2fed0a200b (coreutils-9.5-11.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-2fed0a200b

Comment 9 Fedora Update System 2024-11-13 10:36:49 UTC
FEDORA-2024-b2eca2c8af (coreutils-9.4-9.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-b2eca2c8af

Comment 10 Fedora Update System 2024-11-14 02:13:34 UTC
FEDORA-2024-4b75866373 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-4b75866373`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-4b75866373

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2024-11-14 03:32:08 UTC
FEDORA-2024-b2eca2c8af has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-b2eca2c8af`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-b2eca2c8af

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2024-11-14 07:59:25 UTC
FEDORA-2024-2fed0a200b (coreutils-9.5-11.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2024-11-15 01:20:45 UTC
FEDORA-2024-4b75866373 (coreutils-9.5-11.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2024-11-20 16:21:57 UTC
FEDORA-2024-b2eca2c8af (coreutils-9.4-9.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.