Bug 273675
Summary: | Need to change the method for determining the number of CPUs on Linux | ||
---|---|---|---|
Product: | WebKit | Reporter: | haiweiwang1109 |
Component: | Tools / Tests | Assignee: | Adrian Perez <aperez> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | ahmad.saleem792, clopez, haiweiwang1109, mcatanzaro, philn, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | PC | ||
OS: | Linux |
haiweiwang1109
Determine the number of CPUs on Linux by directly interpreting /proc/cpuinfo, as using the nproc tool may yield incorrect results (`determineNumberOfCPUs` in Tools/Scripts/webkitdirs.pm). Incorrect results (usually bigger than the true number) can lead to OOM issue.
In my ubuntu virtual machine:
```
$ nproc
6
$ nproc --all
128
```
And there are similar discussions on the Arch Linux forum as well.
-[nproc indicating higher number of cpu cores than CPU has](https://bbs.archlinux.org/viewtopic.php?id=278874)
```
$ nproc
24
$ nproc --all
128
```
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/127865622>
Michael Catanzaro
It looks like determineNumberOfCPUs only gets used if you're compiling with make rather than ninja. And that should only happen if you use `build-webkit --no-ninja` or do not have ninja installed. You probably want to build with ninja. It will compute the number of CPUs to use on its own. (Although I wouldn't be surprised if it also uses nproc!)
Anyway, I'll remove the use of nproc.
Michael Catanzaro
Pull request: https://github.com/WebKit/WebKit/pull/28388
Adrian Perez
Pull request: https://github.com/WebKit/WebKit/pull/28645
EWS
Committed 278879@main (9bf347ad34b3): <https://commits.webkit.org/278879@main>
Reviewed commits have been landed. Closing PR #28645 and removing active labels.