mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-24 06:20:43 -08:00
Mps master (integ from br/padding): job002205: if pollthreshold is > 64kib behind fillmutatorsize, make arenapoll call tracepoll many times:
Changes: - separate ArenaPoll and ArenaStep code paths; - simplify ArenaPoll; - loop calling TracePoll to catch-up; - update pollThreshold correctly, depending on whether we have no work and are sleeping, or have work and are advancing the 'clock' by one unit. If there's no work, don't keep checking. Avoid multiple calls to ClockNow(). - ArenaStep should NOT change pollThreshold -- that's ArenaPoll's business. This means ArenaStep may advance, but not retard, trace work. zcoll: 100MB is a more sensible arena size than 0.5 MB test-runner.py: run zcoll; on w3i3, use m9 (=VC9.0) compiler Copied from Perforce Change: 169904 ServerID: perforce.ravenbrook.com
This commit is contained in:
commit
b0df67ea88
3 changed files with 42 additions and 12 deletions
|
|
@ -649,19 +649,51 @@ void (ArenaPoll)(Globals globals)
|
|||
#else
|
||||
void ArenaPoll(Globals globals)
|
||||
{
|
||||
double size;
|
||||
Arena arena;
|
||||
Clock start;
|
||||
Count quanta;
|
||||
Size tracedSize;
|
||||
double nextPollThreshold = 0.0;
|
||||
|
||||
AVERT(Globals, globals);
|
||||
|
||||
if (globals->clamped)
|
||||
return;
|
||||
size = globals->fillMutatorSize;
|
||||
if (globals->insidePoll || size < globals->pollThreshold)
|
||||
if (globals->insidePoll)
|
||||
return;
|
||||
if(globals->fillMutatorSize < globals->pollThreshold)
|
||||
return;
|
||||
|
||||
globals->insidePoll = TRUE;
|
||||
|
||||
(void)ArenaStep(globals, 0.0, 0.0);
|
||||
/* fillMutatorSize has advanced; call TracePoll enough to catch up. */
|
||||
arena = GlobalsArena(globals);
|
||||
start = ClockNow();
|
||||
quanta = 0;
|
||||
while(globals->pollThreshold <= globals->fillMutatorSize) {
|
||||
tracedSize = TracePoll(globals);
|
||||
|
||||
if(tracedSize == 0) {
|
||||
/* No work to do. Sleep until NOW + a bit. */
|
||||
nextPollThreshold = globals->fillMutatorSize + ArenaPollALLOCTIME;
|
||||
} else {
|
||||
/* We did one quantum of work; consume one unit of 'time'. */
|
||||
quanta += 1;
|
||||
arena->tracedSize += tracedSize;
|
||||
nextPollThreshold = globals->pollThreshold + ArenaPollALLOCTIME;
|
||||
}
|
||||
|
||||
/* Advance pollThreshold; check: enough precision? */
|
||||
AVER(nextPollThreshold > globals->pollThreshold);
|
||||
globals->pollThreshold = nextPollThreshold;
|
||||
}
|
||||
|
||||
/* Don't count time spent checking for work, if there was no work to do. */
|
||||
if(quanta > 0) {
|
||||
arena->tracedTime += (ClockNow() - start) / (double) ClocksPerSec();
|
||||
}
|
||||
|
||||
AVER(globals->fillMutatorSize < globals->pollThreshold);
|
||||
|
||||
globals->insidePoll = FALSE;
|
||||
}
|
||||
|
|
@ -714,7 +746,6 @@ static Bool arenaShouldCollectWorld(Arena arena,
|
|||
|
||||
Bool ArenaStep(Globals globals, double interval, double multiplier)
|
||||
{
|
||||
double size;
|
||||
Size scanned;
|
||||
Bool stepped;
|
||||
Clock start, end, now;
|
||||
|
|
@ -756,10 +787,6 @@ Bool ArenaStep(Globals globals, double interval, double multiplier)
|
|||
arena->tracedTime += (now - start) / (double) clocks_per_sec;
|
||||
}
|
||||
|
||||
size = globals->fillMutatorSize;
|
||||
globals->pollThreshold = size + ArenaPollALLOCTIME;
|
||||
AVER(globals->pollThreshold > size); /* enough precision? */
|
||||
|
||||
return stepped;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -704,7 +704,9 @@ int main(int argc, char **argv)
|
|||
/* 16<<20 == 16777216 == 16 Mebibyte */
|
||||
|
||||
/* 1<<19 == 524288 == 1/2 Mebibyte */
|
||||
testscriptA("Arena(size 524288), Make(keep-1-in 5, keep 50000, rootspace 30000, sizemethod 1), Collect.");
|
||||
/* This is bogus! sizemethod 1 can make a 300,000-slot dylan vector, ie. 1.2MB. */
|
||||
/* Try 100MB arena */
|
||||
testscriptA("Arena(size 100000000), Make(keep-1-in 5, keep 50000, rootspace 30000, sizemethod 1), Collect.");
|
||||
|
||||
/* LSP -- Large Segment Padding (job001811)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ def mpsplatformcode() :
|
|||
# Here, we simplify and get it right for Windows and Macs.
|
||||
try :
|
||||
compiler = {'xc':'gc',
|
||||
'w3':'mv',
|
||||
'w3':'m9',
|
||||
}[os]
|
||||
except :
|
||||
pass
|
||||
|
|
@ -79,7 +79,7 @@ mpsplatform = mpsplatformcode()
|
|||
make = ''
|
||||
if mpsplatform[4:6] == 'gc' :
|
||||
make = "make -r -f %s.gmk VARIETY=%%s %%s >> %%s" % mpsplatform
|
||||
elif mpsplatform[4:6] == 'mv' :
|
||||
elif mpsplatform[4:6] == 'm9' :
|
||||
make = "nmake /f %s.nmk VARIETY=%%s %%s.exe >>%%s" % mpsplatform
|
||||
|
||||
run = ''
|
||||
|
|
@ -119,6 +119,7 @@ runtestlist([
|
|||
"awlut",
|
||||
"awluthe",
|
||||
"mpsicv",
|
||||
"zcoll",
|
||||
"zmess",
|
||||
"messtest",
|
||||
], ["we", "hi", "di", "ci"], testout)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue