Skip to content

Commit

Permalink
Partially revert Qthreads patch from #26328 (#26468)
Browse files Browse the repository at this point in the history
Partially reverts a Qthreads patch from #26328 which resulted in a
performance penalty. The patch was meant to fix some performance
regressions, but instead caused more than it helped.

This PR only reverts the changes to the definition of MACHINE_FENCE.

Closes #26440

[Reviewed by @jhh67]
  • Loading branch information
jabraham17 authored Jan 6, 2025
2 parents 3ce06c9 + 1e35ac1 commit 8d2f1e4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
14 changes: 0 additions & 14 deletions third-party/qthread/README
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,3 @@ index 2ac887ed..2312c954 100644
atomic_fetch_sub_explicit(&io_worker_count, 1, memory_order_relaxed);
pthread_exit(NULL);
```

```
--- a/include/qthread/qthread.h
+++ b/include/qthread/qthread.h
@@ -87,7 +87,7 @@ using std::memory_order_relaxed;

#include "macros.h"

-#define MACHINE_FENCE atomic_thread_fence(memory_order_acq_rel);
+#define MACHINE_FENCE atomic_thread_fence(memory_order_seq_cst);

#if QTHREAD_ASSEMBLY_ARCH == QTHREAD_AMD64
#define QTHREAD_SWAPS_IMPLY_ACQ_REL_FENCES
```
2 changes: 1 addition & 1 deletion third-party/qthread/qthread-src/include/qthread/qthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ using std::memory_order_relaxed;

#include "macros.h"

#define MACHINE_FENCE atomic_thread_fence(memory_order_seq_cst);
#define MACHINE_FENCE atomic_thread_fence(memory_order_acq_rel);

#if QTHREAD_ASSEMBLY_ARCH == QTHREAD_AMD64
#define QTHREAD_SWAPS_IMPLY_ACQ_REL_FENCES
Expand Down

0 comments on commit 8d2f1e4

Please sign in to comment.