[PATCH] D129089: [BOLT] Fix concurrent hash table modification in the instrumentation runtime
    MichaĆ Chojnowski via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Jul  6 05:36:47 PDT 2022
    
    
  
michoecho updated this revision to Diff 442531.
michoecho retitled this revision from "[BOLT] Fix concurrency bugs in the instrumentation runtime" to "[BOLT] Fix concurrent hash table modification in the instrumentation runtime".
michoecho edited the summary of this revision.
michoecho added a comment.
I have removed the Mutex fix from the diff, since the alternative fix (https://reviews.llvm.org/D129162) has been merged.
The `__bolt_instr_data_dump()` fix remains.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129089/new/
https://reviews.llvm.org/D129089
Files:
  bolt/runtime/instr.cpp
Index: bolt/runtime/instr.cpp
===================================================================
--- bolt/runtime/instr.cpp
+++ bolt/runtime/instr.cpp
@@ -289,6 +289,7 @@
   /// Traverses all elements in the table
   template <typename... Args>
   void forEachElement(void (*Callback)(MapEntry &, Args...), Args... args) {
+    Lock L(M);
     if (!TableRoot)
       return;
     return forEachElement(Callback, InitialSize, TableRoot, args...);
@@ -378,7 +379,6 @@
 
 template <typename T, uint32_t X, uint32_t Y>
 void SimpleHashTable<T, X, Y>::resetCounters() {
-  Lock L(M);
   forEachElement(resetIndCallCounter);
 }
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129089.442531.patch
Type: text/x-patch
Size: 625 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220706/2ce19fb0/attachment.bin>
    
    
More information about the llvm-commits
mailing list