1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-24 07:41:54 -07:00

Mps br/padding: make arenapoll do lots of tracepolls if required, to catch up after fillmutatorsize jumps by > 64kib (job002205)

Changes:
  - separate ArenaPoll and ArenaStep code paths;
  - simplify ArenaPoll;
  - loop calling TracePoll to catch-up;
  zcoll: 100MB is a more sensible arena size than 0.5 MB
Warning: barely "experimental" code quality, omitting the following necessities:
  - consideration of interactions with ArenaStep,
  - re-engineering of ArenaPoll and friends.

Copied from Perforce
 Change: 169814
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Richard Kistruck 2010-02-12 14:16:53 +00:00
parent 6c29372e90
commit 74ff7d56bc
2 changed files with 31 additions and 5 deletions

View file

@ -649,19 +649,43 @@ void (ArenaPoll)(Globals globals)
#else
void ArenaPoll(Globals globals)
{
double size;
Arena arena;
Clock start;
Size tracedSize;
Bool didSomeTraceWork = FALSE;
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. */
start = ClockNow();
arena = GlobalsArena(globals);
do {
tracedSize = TracePoll(globals);
if(tracedSize == 0)
break;
didSomeTraceWork = TRUE;
arena->tracedSize += tracedSize;
/* Increment pollThreshold; check: enough precision? */
AVER(globals->pollThreshold
< globals->pollThreshold + ArenaPollALLOCTIME);
globals->pollThreshold += ArenaPollALLOCTIME;
} while (tracedSize > 0
&& globals->pollThreshold <= globals->fillMutatorSize);
if(didSomeTraceWork) {
arena->tracedTime += (ClockNow() - start) / (double) ClocksPerSec();
}
globals->insidePoll = FALSE;
}

View file

@ -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)
*