Skip to content

Commit

Permalink
Revert "Don't use exchange in the hot path of the GC (#50021)"
Browse files Browse the repository at this point in the history
This reverts commit 0a2d6fc.
  • Loading branch information
d-netto committed Jul 18, 2023
1 parent f19c9cf commit 21941a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ STATIC_INLINE void gc_queue_big_marked(jl_ptls_t ptls, bigval_t *hdr,
FORCE_INLINE int gc_try_setmark_tag(jl_taggedvalue_t *o, uint8_t mark_mode) JL_NOTSAFEPOINT
{
assert(gc_marked(mark_mode));
uintptr_t tag = jl_atomic_load_relaxed((_Atomic(uintptr_t)*)&o->header);
uintptr_t tag = o->header;
if (gc_marked(tag))
return 0;
if (mark_reset_age) {
Expand All @@ -813,9 +813,9 @@ FORCE_INLINE int gc_try_setmark_tag(jl_taggedvalue_t *o, uint8_t mark_mode) JL_N
tag = tag | mark_mode;
assert((tag & 0x3) == mark_mode);
}
jl_atomic_store_relaxed((_Atomic(uintptr_t)*)&o->header, tag); //xchg here was slower than
verify_val(jl_valueof(o)); //potentially redoing work because of a stale tag.
return 1;
tag = jl_atomic_exchange_relaxed((_Atomic(uintptr_t)*)&o->header, tag);
verify_val(jl_valueof(o));
return !gc_marked(tag);
}

// This function should be called exactly once during marking for each big
Expand Down

0 comments on commit 21941a3

Please sign in to comment.