[Cuirass] ‘cuirass remote-worker’ gets the CPU count wrong on the OverDrive
(address . bug-guix@gnu.org)
On the OverDrive (AArch64), ‘cuirass remote-worker’ (1.2.0-1.bdc1f9f) says:
starting 2 workers (parallelism: 1 cores) for server at 10.0.0.1
Instead it should use two cores for each worker:
Toggle snippet (10 lines)
ludo@dover ~$ guile -c '(use-modules (ice-9 threads)) (pk (current-processor-count))'
;;; (4)
ludo@dover ~$ guile -c '(use-modules (ice-9 threads)) (pk (ceiling-quotient (current-processor-count) 2))'
;;; (2)
ludo@dover ~$ nproc
4
Since ‘current-processor-count’ is implemented indirectly in terms of
‘sched_getaffinity’, this suggests that the process starts with a bogus
affinity mask. (Time passes…) That’s indeed the case:
Toggle snippet (13 lines)
ludo@dover ~$ sudo herd status cuirass-remote-worker
Status of cuirass-remote-worker:
It is started.
Running value is 21279.
It is enabled.
Provides (cuirass-remote-worker).
Requires (avahi-daemon guix-daemon networking).
Will be respawned.
ludo@dover ~$ guile -c '(pk (getaffinity 21279))'
;;; (#*1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
Compare to the affinity mask on x86_64-linux-gnu:
Toggle snippet (5 lines)
ludo@guix-hpc3 ~$ sudo guile -c '(pk (getaffinity 1817))'
;;; (#*1111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
Interesting that the initial affinity mask differs on aarch64-linux-gnu
compared to x86_64-linux-gnu.
Ludo’.