vmm: use available_parallelism for prefault threads - #8538
Conversation
rbradford
left a comment
There was a problem hiding this comment.
Thanks! I know bytes are expensive these days but I think we can afford to have a commit message body :-)
Also include the issue number in the commit message body (and if you had used gh to create the PR it would have filled the PR description from the body).
62d75cb to
28f4e44
Compare
f9a80be to
0102c03
Compare
10414f5 to
cee8b0e
Compare
| @@ -2223,14 +2222,11 @@ impl MemoryManager { | |||
| } | |||
There was a problem hiding this comment.
Please review the CONTRIBUTING.md file and look at the existing commits and fix your commit message.
There was a problem hiding this comment.
Commit message still isn't right. It wasn't using a fixed default before - it was accessing the number of vCPUs via sysconf (which is what the new API does under the hood).
There was a problem hiding this comment.
ahh sorry. updated with
Use std::thread::available_parallelism() when sizing the prefault
worker threads so the number of threads scales with the host CPU
count instead of relying on unsafe sysconf.
please feel free to suggest if you have something else in mind
There was a problem hiding this comment.
updated. didn't realize it is that strict
171343b to
2b27bba
Compare
8338dd0 to
cf88210
Compare
|
Thanks! |
|
@pkbhowmick Fails stable clippy. |
Use std::thread::available_parallelism() when sizing the prefault worker threads so the number of threads scales with the host CPU count instead of relying on unsafe sysconf. Fixes: cloud-hypervisor#8495 Signed-off-by: Pulak Kanti Bhowmick <[email protected]>
cf88210 to
373061e
Compare
rbradford
left a comment
There was a problem hiding this comment.
I gave up waiting for the ~30s fix and just updated the PR. Thanks.
fix #8495