[PATCH] D73055: [scudo][standalone] Allow sched_getaffinity to fail

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 15:42:10 PST 2020


hctim added inline comments.


================
Comment at: compiler-rt/lib/scudo/standalone/linux.cpp:133
 
+// sched_getaffinity can fail (no CAP_SYS_NICE, syscall filtering, etc), in
+// which case the function shall return 0.
----------------
Should probably add comment about the zero error-condition to the shared header.


================
Comment at: compiler-rt/lib/scudo/standalone/tsd_shared.h:23
+    NumberOfTSDs =
+        (NumberOfCPUs == 0) ? MaxTSDCount : Min(NumberOfCPUs, MaxTSDCount);
     TSDs = reinterpret_cast<TSD<Allocator> *>(
----------------
Should the fallback here still be `1` instead of `MaxTSDCount`? Seems to me like falling back to having a single TSD is safer than spawning 8 (for fuchsia) or 2 (for android) for a single-threaded program.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73055/new/

https://reviews.llvm.org/D73055





More information about the llvm-commits mailing list