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

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 11:27:14 PST 2020


eugenis accepted this revision.
eugenis added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: compiler-rt/lib/scudo/standalone/tsd_shared.h:23
+    NumberOfTSDs =
+        (NumberOfCPUs == 0) ? MaxTSDCount : Min(NumberOfCPUs, MaxTSDCount);
     TSDs = reinterpret_cast<TSD<Allocator> *>(
----------------
cryptoad wrote:
> hctim wrote:
> > 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.
> I debated this, and I think that having a fallback to 1 is very restricting, eg: a single cache/lock.
> I think it's less limiting to fallback to multiple caches, it will potentially allow us to make use of multiple cores if there are more than 1. If not, everything still works but we use a bit more memory which I don't think is a big issue.
I think I also prefer to fallback to MaxTSDCount.


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