[PATCH] D73010: [llvm-lto2] By default, use two threads for ThinLTO backend.

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 19 17:51:10 PST 2020


ychen created this revision.
ychen added reviewers: mehdi_amini, tejohnson, pcc.
Herald added subscribers: llvm-commits, steven.zhang, jfb, dexonsmith, steven_wu, hiraditya, inglorion.
Herald added a project: LLVM.

Some bots are reporting `Resource temporarily unavailable` because of D67847 <https://reviews.llvm.org/D67847>.
http://lab.llvm.org:8011/builders/clang-ppc64le-rhel/builds/592/steps/ninja%20check%201/logs/stdio

It is likely that too many threads are spawned since `lit -j` and
thin backend parallelism are in effect at same time.

terminate called after throwing an instance of 'std::system_error'

  what():  Resource temporarily unavailable

Stack dump:
0.	Program arguments: /home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/bin/llvm-lto2 /home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/bin/llvm-lto2 -O0 -save-temps /home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/test/ThinLTO/X86/Output/index-const-prop-O0.ll.tmp2.bc -r=/home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/test/ThinLTO/X86/Output/index-const-prop-O0.ll.tmp2.bc,g,pl /home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/test/ThinLTO/X86/Output/index-const-prop-O0.ll.tmp1.bc -r=/home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/test/ThinLTO/X86/Output/index-const-prop-O0.ll.tmp1.bc,main,plx -r=/home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/test/ThinLTO/X86/Output/index-const-prop-O0.ll.tmp1.bc,g, -o /home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/test/ThinLTO/X86/Output/index-const-prop-O0.ll.tmp3 
 #0 0x00007357b43b1a34 PrintStackTraceSignalHandler(void*) (/home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/bin/../lib/libLLVMSupport.so.11git+0x1f1a34)
 #1 0x00007357b43ae7a8 llvm::sys::RunSignalHandlers() (/home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/bin/../lib/libLLVMSupport.so.11git+0x1ee7a8)
 #2 0x00007357b43b1ea4 SignalHandler(int) (/home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/bin/../lib/libLLVMSupport.so.11git+0x1f1ea4)
 #3 0x00007357b8ac04d8  0x4d8 abort
 #4 0x00007357b8ac04d8 /usr/src/debug/glibc-2.17-c758a686/stdlib/abort.c:75:0 
 #5 0x00007357b8ac04d8 __gnu_cxx::__verbose_terminate_handler() (+0x4d8)
 #6 0x00007357b3cd20b4 (/lib64/libc.so.6+0x420b4)
 #7 0x00007357b403eda4 std::terminate() (/lib64/libstdc++.so.6+0x8eda4)
 #8 0x00007357b403b5d4 __cxa_throw (/lib64/libstdc++.so.6+0x8b5d4)
 #9 0x00007357b403b624 std::__throw_system_error(int) (/lib64/libstdc++.so.6+0x8b624)
#10 0x00007357b403baa8 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/lib64/libstdc++.so.6+0x8baa8)
#11 0x00007357b43b5290 llvm::ThreadPool::ThreadPool(unsigned int) (/home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/bin/../lib/libLLVMSupport.so.11git+0x1f5290)
#12 0x00007357b43b77b8 std::_Function_handler<std::unique_ptr<llvm::lto::ThinBackendProc, std::default_delete<llvm::lto::ThinBackendProc> > (llvm::lto::Config const&, llvm::ModuleSummaryIndex&, llvm::StringMap<llvm::DenseMap<unsigned long, llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long>, llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*> >, llvm::MallocAllocator>&, std::function<std::unique_ptr<llvm::lto::NativeObjectStream, std::default_delete<llvm::lto::NativeObjectStream> > (unsigned int)>, std::function<std::function<std::unique_ptr<llvm::lto::NativeObjectStream, std::default_delete<llvm::lto::NativeObjectStream> > (unsigned int)> (unsigned int, llvm::StringRef)>), llvm::lto::createInProcessThinBackend(unsigned int)::$_9>::_M_invoke(std::_Any_data const&, llvm::lto::Config const&, llvm::ModuleSummaryIndex&, llvm::StringMap<llvm::DenseMap<unsigned long, llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long>, llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*> >, llvm::MallocAllocator>&, std::function<std::unique_ptr<llvm::lto::NativeObjectStream, std::default_delete<llvm::lto::NativeObjectStream> > (unsigned int)>&&, std::function<std::function<std::unique_ptr<llvm::lto::NativeObjectStream, std::default_delete<llvm::lto::NativeObjectStream> > (unsigned int)> (unsigned int, llvm::StringRef)>&&) (/home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/bin/../lib/libLLVMSupport.so.11git+0x1f77b8)
#13 0x00007357b433da34 llvm::lto::LTO::runThinLTO(std::function<std::unique_ptr<llvm::lto::NativeObjectStream, std::default_delete<llvm::lto::NativeObjectStream> > (unsigned int)>, std::function<std::function<std::unique_ptr<llvm::lto::NativeObjectStream, std::default_delete<llvm::lto::NativeObjectStream> > (unsigned int)> (unsigned int, llvm::StringRef)>, llvm::DenseSet<unsigned long, llvm::DenseMapInfo<unsigned long> > const&) (/home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/bin/../lib/libLLVMSupport.so.11git+0x17da34)
#14 0x00007357b487c124 llvm::lto::LTO::run(std::function<std::unique_ptr<llvm::lto::NativeObjectStream, std::default_delete<llvm::lto::NativeObjectStream> > (unsigned int)>, std::function<std::function<std::unique_ptr<llvm::lto::NativeObjectStream, std::default_delete<llvm::lto::NativeObjectStream> > (unsigned int)> (unsigned int, llvm::StringRef)>) (/home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/bin/../lib/libLLVMLTO.so.11git+0x2c124)
#15 0x00007357b4874354 run(int, char**) (/home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/bin/../lib/libLLVMLTO.so.11git+0x24354)
#16 0x00007357b4873150 main (/home/docker/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/stage1/bin/../lib/libLLVMLTO.so.11git+0x23150)
#17 0x00000000100127cc generic_start_main.isra.0 /usr/src/debug/glibc-2.17-c758a686/csu/../csu/libc-start.c:266:0
#18 0x000000001000f6dc __libc_start_main /usr/src/debug/glibc-2.17-c758a686/csu/../sysdeps/unix/sysv/linux/powerpc/libc-start.c:81:0


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73010

Files:
  llvm/tools/llvm-lto2/llvm-lto2.cpp


Index: llvm/tools/llvm-lto2/llvm-lto2.cpp
===================================================================
--- llvm/tools/llvm-lto2/llvm-lto2.cpp
+++ llvm/tools/llvm-lto2/llvm-lto2.cpp
@@ -65,8 +65,7 @@
                                        "import files for the "
                                        "distributed backend case"));
 
-static cl::opt<int> Threads("thinlto-threads",
-                            cl::init(llvm::heavyweight_hardware_concurrency()));
+static cl::opt<int> Threads("thinlto-threads", cl::init(2));
 
 static cl::list<std::string> SymbolResolutions(
     "r",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73010.239015.patch
Type: text/x-patch
Size: 595 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200120/7db50470/attachment.bin>


More information about the llvm-commits mailing list