1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-24 14:30:43 -08:00

Fix the mortality of the world to avoid runaway feedback between the dynamic criterion and the mortality of the arena's top generation as described in <https://info.ravenbrook.com/mail/2018/07/13/19-53-23/0/>.

Copied from Perforce
 Change: 194648
This commit is contained in:
Gareth Rees 2018-07-13 20:56:08 +01:00
parent 326a8c6bbd
commit b60a1636fc

View file

@ -265,6 +265,11 @@ Bool PolicyStartTrace(Trace *traceReturn, Bool *collectWorldReturn,
Res res;
Trace trace;
double TraceWorkFactor = 0.25;
/* Fix the mortality of the world to avoid runaway feedback between the
dynamic criterion and the mortality of the arena's top generation,
leading to all traces collecting the world. This is a (hopefully)
temporary hack, pending an improved scheduling algorithm. */
double TraceWorldMortality = 0.5;
AVER(traceReturn != NULL);
AVERT(Arena, arena);
@ -278,7 +283,7 @@ Bool PolicyStartTrace(Trace *traceReturn, Bool *collectWorldReturn,
sFoundation = (Size)0; /* condemning everything, only roots @@@@ */
/* @@@@ sCondemned should be scannable only */
sCondemned = ArenaCommitted(arena) - ArenaSpareCommitted(arena);
sSurvivors = (Size)(sCondemned * (1 - arena->topGen.mortality));
sSurvivors = (Size)(sCondemned * (1 - TraceWorldMortality));
tTracePerScan = sFoundation + (sSurvivors * (1 + TraceCopyScanRATIO));
AVER(TraceWorkFactor >= 0);
AVER(sSurvivors + tTracePerScan * TraceWorkFactor <= (double)SizeMAX);