Page MenuHomePhabricator

[OpenMP] Fix affinity determine capable algorithm on Linux

Authored by jlpeyton on Jun 3 2021, 11:00 AM.



Remove strange checks for syscall() arguments where mask is NULL.
Valgrind reports these as error usages for the syscall.
Instead, just check if CACHE_LINE bytes is long enough. If not, then
search for the size. Also, by limiting the first size detection
attempt to CACHE_LINE bytes, instead of 1MB, we don't use more than one
cache line for the mask size. Before this patch, sometimes the returned
mask size was 640 bytes (10 cache lines) because the initial call to
getaffinity() was limited only by the internal kernel mask size
which can be very large.

Diff Detail

Event Timeline

jlpeyton created this revision.Jun 3 2021, 11:00 AM
jlpeyton requested review of this revision.Jun 3 2021, 11:00 AM
This revision is now accepted and ready to land.Jun 9 2021, 5:37 AM
This revision was landed with ongoing or failed builds.Jun 15 2021, 2:24 PM
This revision was automatically updated to reflect the committed changes.