Skip to content

Conversation

junaruga
Copy link
Member

Use nproc rather than nproc --all. Because the number by the nproc is different from the number by the nproc --all on GitHub Actions ppc64le/s390x. This caused the make command runs much more jobs than the number of on-line CPUs. The make command ran 193 jobs in parallel for 4 on-line CPUs in GitHub Actions ppc64le, and ran 9 jobs in parallel for 4 on-line CPUs in GitHub Actions s390x.

And this caused the high load average 34.58 on ppc64le, and 6.69 on s390x. These values should be less than 4.0. I believe we should use the nproc rather than nproc --all.

+ nproc
4
+ nproc --all
192
+ nproc
4
+ nproc --all
8

See IBM/actionspz#38 for details.

@junaruga
Copy link
Member Author

junaruga commented Aug 26, 2025

@shyouhei I see you added the .github/actions/setup/directories/action.yml at the commit 420d069. Perhaps you also might added the logic for the nproc --all. I would like you to review this PR's change. Thanks!

@junaruga junaruga marked this pull request as ready for review August 26, 2025 16:01
Copy link
Member

@shyouhei shyouhei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At that time I added this code, hyper threading was still a thing. Under such circumstance nproc --all boosted overall CI speed. But that was an old story. Now that datacenter CPUs employ completely different setups. Removing --all just makes sense today. LGTM.

@junaruga junaruga force-pushed the wip/gha-nproc-for-gnumakeflags branch from ca37b6a to 1a9b08b Compare August 27, 2025 10:54
Use `nproc` rather than `nproc --all`. Because the number by the `nproc` is
different from the number by the `nproc --all` on GitHub Actions ppc64le/s390x.
This caused the `make` command runs much more jobs than the number of on-line
CPUs on these environments.
The make command ran 193 jobs in parallel for 4 on-line CPUs in GitHub Actions
ppc64le, and ran 9 jobs in parallel for 4 on-line CPUs in GitHub Actions s390x.

And this caused the high load average 34.58 on ppc64le, and 6.69 on s390x.
These values should be less than 4.0. I believe we should use the `nproc`
rather than `nproc --all`.

```
+ nproc
4
+ nproc --all
192
```

```
+ nproc
4
+ nproc --all
8
```

See IBM/actionspz#38 for details.

Note the `--all` option in the `nproc --all` was originally added to boost CPU
in a hyper threading environment where one physical core works like two logical
cores.

https://www.intel.com/content/www/us/en/gaming/resources/hyper-threading.html
@junaruga junaruga force-pushed the wip/gha-nproc-for-gnumakeflags branch from 1a9b08b to 1ad67e2 Compare August 27, 2025 13:15
@junaruga
Copy link
Member Author

Thanks for your review and info! I updated the commit message adding the context about the hyper threading, and rebasing this PR on the latest master branch.

@junaruga junaruga enabled auto-merge (rebase) August 27, 2025 13:22
@junaruga junaruga merged commit 47d4cce into ruby:master Aug 27, 2025
83 checks passed
@junaruga junaruga deleted the wip/gha-nproc-for-gnumakeflags branch August 27, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants