HomePhabricator

[OpenMP] Fix affinity determine capable algorithm on Linux

Authored by jlpeyton on Jun 3 2021, 10:49 AM.

Description

[OpenMP] Fix affinity determine capable algorithm on Linux

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.

Differential Revision: https://reviews.llvm.org/D103637

Details

Committed
jlpeytonJun 15 2021, 2:21 PM
Differential Revision
D103637: [OpenMP] Fix affinity determine capable algorithm on Linux
Parents
rG0ddde4d86518: [OpenMP] Lazily assign root affinity
Branches
Unknown
Tags
Unknown