mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-24 14:30:43 -08:00
Don't represent capacities internally in kilobytes, convert once on initialization.
In the monitor, start average mortality time series with the initial predicted value. Copied from Perforce Change: 194565
This commit is contained in:
parent
14b0146a31
commit
df41d66de5
5 changed files with 11 additions and 7 deletions
|
|
@ -744,7 +744,9 @@
|
|||
#define EVENT_GenInit_PARAMS(PARAM, X) \
|
||||
PARAM(X, 0, P, arena) /* arena owning generation */ \
|
||||
PARAM(X, 1, P, gen) /* the generation */ \
|
||||
PARAM(X, 2, U, serial) /* serial number within arena */
|
||||
PARAM(X, 2, U, serial) /* serial number within arena */ \
|
||||
PARAM(X, 3, W, capacity) /* capacity in bytes */ \
|
||||
PARAM(X, 4, D, mortality) /* initial mortality estimate */
|
||||
|
||||
#define EVENT_GenFinish_PARAMS(PARAM, X) \
|
||||
PARAM(X, 0, P, arena) /* arena owning generation */ \
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ static Bool GenParamCheck(GenParamStruct *params)
|
|||
{
|
||||
CHECKL(params != NULL);
|
||||
CHECKL(params->capacity > 0);
|
||||
CHECKL(params->capacity <= SizeMAX / 1024);
|
||||
CHECKL(params->mortality >= 0.0);
|
||||
CHECKL(params->mortality <= 1.0);
|
||||
return TRUE;
|
||||
|
|
@ -139,13 +140,13 @@ static void GenDescInit(Arena arena, GenDesc gen, GenParamStruct *params)
|
|||
gen->serial = arena->genSerial;
|
||||
++ arena->genSerial;
|
||||
gen->zones = ZoneSetEMPTY;
|
||||
gen->capacity = params->capacity;
|
||||
gen->capacity = params->capacity * 1024;
|
||||
gen->mortality = params->mortality;
|
||||
RingInit(&gen->locusRing);
|
||||
RingInit(&gen->segRing);
|
||||
gen->sig = GenDescSig;
|
||||
AVERT(GenDesc, gen);
|
||||
EVENT3(GenInit, arena, gen, gen->serial);
|
||||
EVENT5(GenInit, arena, gen, gen->serial, gen->capacity, gen->mortality);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -458,7 +459,7 @@ double ChainDeferral(Chain chain)
|
|||
|
||||
if (chain->activeTraces == TraceSetEMPTY) {
|
||||
for (i = 0; i < chain->genCount; ++i) {
|
||||
double genTime = chain->gens[i].capacity * 1024.0
|
||||
double genTime = (double)chain->gens[i].capacity
|
||||
- (double)GenDescNewSize(&chain->gens[i]);
|
||||
if (genTime < time)
|
||||
time = genTime;
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ typedef struct GenDescStruct {
|
|||
Sig sig; /* <design/sig/> */
|
||||
Serial serial; /* serial number within arena */
|
||||
ZoneSet zones; /* zoneset for this generation */
|
||||
Size capacity; /* capacity in kB */
|
||||
double mortality; /* predicted mortality */
|
||||
Size capacity; /* capacity in bytes */
|
||||
double mortality; /* moving average mortality */
|
||||
RingStruct locusRing; /* Ring of all PoolGen's in this GenDesc (locus) */
|
||||
RingStruct segRing; /* Ring of GCSegs in this generation */
|
||||
GenTraceStatsStruct trace[TraceLIMIT];
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ static Res policyCondemnChain(double *mortalityReturn, Chain chain, Trace trace)
|
|||
gen = &chain->gens[topCondemnedGen];
|
||||
AVERT(GenDesc, gen);
|
||||
genNewSize = GenDescNewSize(gen);
|
||||
if (genNewSize >= gen->capacity * (Size)1024)
|
||||
if (genNewSize >= gen->capacity)
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -310,6 +310,7 @@ class Gen(EventHandler):
|
|||
self._model.add_time_series(
|
||||
self, mortality_average, "fraction", f"mortality.avg",
|
||||
f"mortality of data in generation, moving average")
|
||||
mortality_average.append(t, event.mortality);
|
||||
self._ref_size = ref_size = TimeSeries()
|
||||
self._model.add_time_series(
|
||||
self, ref_size, "bytes", f"ref",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue