Skip to content

Commit

Permalink
Revert "Fix performance regression caused by a bug fix"
Browse files Browse the repository at this point in the history
This reverts commit 13df903.
  • Loading branch information
bjorng committed Aug 27, 2024
1 parent 13df903 commit b66938c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 33 deletions.
31 changes: 3 additions & 28 deletions erts/emulator/beam/erl_gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,15 +560,10 @@ delay_garbage_collection(Process *p, int need, int fcalls)
p->abandoned_heap = orig_heap;
erts_adjust_memory_break(p, orig_htop - p->high_water);

#ifdef BEAMASM
/* Point at the end of the address range to ensure that
* test for the safe range in the new heap in the
* update_record_in_place instruction fails. Save the previous
* value of the high water mark to make it possible to make the
* next GC a minor one. */
p->abandoned_high_water = p->high_water;
* update_record_in_place instruction fails. */
p->high_water = (Eterm *) (Uint) -1;
#endif
}

#ifdef CHECK_FOR_HOLES
Expand Down Expand Up @@ -1387,35 +1382,15 @@ minor_collection(Process* p, ErlHeapFragment *live_hf_end,
Uint need, Eterm* objv, int nobj,
Uint ygen_usage, Uint *recl)
{
Eterm *mature;
Uint mature_size;
Eterm *mature = p->abandoned_heap ? p->abandoned_heap : p->heap;
Uint mature_size = p->high_water - mature;
Uint size_before = ygen_usage;
#ifdef DEBUG
Uint debug_tmp = 0;
#endif

need += S_RESERVED;

#if defined(DEBUG) && defined(BEAMASM)
if (p->abandoned_heap) {
ASSERT(p->abandoned_heap <= p->abandoned_high_water);
ASSERT(p->abandoned_high_water != (Eterm *) (Uint) -1);
}
#endif

if (p->abandoned_heap) {
#ifdef BEAMASM
Eterm *high_water = p->abandoned_high_water;
#else
Eterm *high_water = p->high_water;
#endif
mature = p->abandoned_heap;
mature_size = high_water - mature;
} else {
mature = p->heap;
mature_size = p->high_water - mature;
}

/*
* Check if we have gone past the max heap size limit
*/
Expand Down
5 changes: 0 additions & 5 deletions erts/emulator/beam/erl_process.h
Original file line number Diff line number Diff line change
Expand Up @@ -1113,11 +1113,6 @@ struct process {
Uint16 gen_gcs; /* Number of (minor) generational GCs. */
Uint16 max_gen_gcs; /* Max minor gen GCs before fullsweep. */
Eterm *high_water;

#ifdef BEAMASM
Eterm *abandoned_high_water;
#endif

Eterm *old_hend; /* Heap pointers for generational GC. */
Eterm *old_htop;
Eterm *old_heap;
Expand Down

0 comments on commit b66938c

Please sign in to comment.