Skip to content

win: compute parallelism from process cpu affinity#4521

Merged
bnoordhuis merged 2 commits intolibuv:v1.xfrom
bnoordhuis:fix4520
Aug 26, 2024
Merged

win: compute parallelism from process cpu affinity#4521
bnoordhuis merged 2 commits intolibuv:v1.xfrom
bnoordhuis:fix4520

Conversation

@bnoordhuis
Copy link
Copy Markdown
Member

Use GetProcessAffinityMask() to estimate the available parallelism. Before this commit, it simply used the number of available CPUs.

Fixes: #4520

Use GetProcessAffinityMask() to estimate the available parallelism.
Before this commit, it simply used the number of available CPUs.

Fixes: libuv#4520
@giordano
Copy link
Copy Markdown

giordano commented Aug 25, 2024

Double checking: would this be consistent with uv_thread_getaffinity? If I'm reading

libuv/src/win/core.c

Lines 752 to 754 in b5eb41d

int uv_cpumask_size(void) {
return (int)(sizeof(DWORD_PTR) * 8);
}
correctly, on Windows the mask size is always limited to 64 (or whatever is the number of bits of DWORD_PTR), right?

@bnoordhuis
Copy link
Copy Markdown
Member Author

on Windows the mask size is always limited to 64

Yes. Improving support for systems with more than 64 CPUs is an outstanding todo.

@giordano
Copy link
Copy Markdown

Perfect, consistency is very useful, too! Thanks a lot for the quick resolution!

@bnoordhuis bnoordhuis merged commit 58dfb6c into libuv:v1.x Aug 26, 2024
@bnoordhuis bnoordhuis deleted the fix4520 branch August 26, 2024 08:22
giordano pushed a commit to JuliaLang/libuv that referenced this pull request Aug 26, 2024
Use GetProcessAffinityMask() to estimate the available parallelism.
Before this commit, it simply used the number of available CPUs.

Fixes: libuv#4520
giordano pushed a commit to JuliaLang/libuv that referenced this pull request Aug 26, 2024
Use GetProcessAffinityMask() to estimate the available parallelism.
Before this commit, it simply used the number of available CPUs.

Fixes: libuv#4520
(cherry picked from commit 58dfb6c)
giordano pushed a commit to JuliaLang/libuv that referenced this pull request Aug 31, 2024
Use GetProcessAffinityMask() to estimate the available parallelism.
Before this commit, it simply used the number of available CPUs.

Fixes: libuv#4520
(cherry picked from commit 58dfb6c)
giordano added a commit to giordano/Yggdrasil that referenced this pull request Aug 31, 2024
giordano added a commit to giordano/Yggdrasil that referenced this pull request Aug 31, 2024
giordano added a commit to JuliaPackaging/Yggdrasil that referenced this pull request Aug 31, 2024
giordano added a commit to JuliaLang/julia that referenced this pull request Aug 31, 2024
Corresponding PR to Yggdrasil:
JuliaPackaging/Yggdrasil#9337.

This build includes backports of
libuv/libuv#4278 (useful for for #46226) and
libuv/libuv#4521 (useful for #55592)
KristofferC pushed a commit to JuliaLang/julia that referenced this pull request Sep 12, 2024
Corresponding PR to Yggdrasil:
JuliaPackaging/Yggdrasil#9337.

This build includes backports of
libuv/libuv#4278 (useful for for #46226) and
libuv/libuv#4521 (useful for #55592)
kshyatt pushed a commit to JuliaLang/julia that referenced this pull request Sep 12, 2024
Corresponding PR to Yggdrasil:
JuliaPackaging/Yggdrasil#9337.

This build includes backports of
libuv/libuv#4278 (useful for for #46226) and
libuv/libuv#4521 (useful for #55592)
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.

win: uv_available_parallelism doesn't respect process affinity

3 participants