[Openmp-commits] [PATCH] D103637: [OpenMP] Fix affinity determine capable algorithm on Linux

Jonathan Peyton via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jun 3 11:00:51 PDT 2021


jlpeyton created this revision.
jlpeyton added reviewers: AndreyChurbanov, tlwilmar, hbae, Nawrin.
jlpeyton added a project: OpenMP.
Herald added subscribers: guansong, yaxunl.
jlpeyton requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103637

Files:
  openmp/runtime/src/z_Linux_util.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103637.349610.patch
Type: text/x-patch
Size: 5514 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210603/c200b9d6/attachment.bin>


More information about the Openmp-commits mailing list