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
Drop mps_lib_callback_register from w3gen.def, and put it in new file mpslibcb.def, used only when building the MPS DLL (rule in commpost.nmk) which contains the mpslibcb stuff. Correct expgen.sh accordingly (even though it's not working). So mps-fns.def (produced by w3build.bat by copying w3gen.def) is now correct for Configura to use to re-export MPS functions static linked into a larger executable, and mpsdy.dll still correctly exports the mps_lib_callback_register function.
Copied from Perforce
Change: 169899
ServerID: perforce.ravenbrook.com
See design/poolamc for thorough documentation.
AMCBufferFill, for large requests (> 8 ArenaAligns) now gives precisely the requested size to the buffer, and immediately pads the rest [poolamc.c]. See #define AMCLargeSegPAGES 8 [config.h].
New PoolTraceEndMethod -- do end-of-trace work:
Tracer calls PoolTraceEnd() after reclaim, when the trace is TraceFINISHED [trace.c]. AbstractPoolClass uses PoolTrivTraceEnd -- a NOOP [mpm.h, mpmst.h, mpmtypes.h, pool.c, poolabs.c, pooln.c]. AMC overrides with AMCTraceEnd, to emit diagnostic about how well the trace went [poolamc.c].
DIAGNOSTICS:
AMCTraceEnd_pageret: reports page retention (currently gated to only emit if >= 100 pages are retained).
traceSetSignalEmergency: warn when a trace enters emergency mode.
DIAG buffer now 200K, and copes with overflow.
TESTS:
zcoll.c: Test allocation of mixed big and small objects. Test allocation of big object immediately followed by a retained small object, to test AMC LSP.
Copied from Perforce
Change: 169898
ServerID: perforce.ravenbrook.com
ArenaPoll will still call TracePoll if clamped...
but TracePoll won't start a new trace if clamped
ArenaStep won't start an opportunistic full collect if clamped
ArenaStep won't advance pollThreshold, ever
traceFlip asserts that clamped is FALSE.
(see http://info.ravenbrook.com/mail/2010/02/23/13-19-24/0.txt)
---
But no, clamped is more complex than that.
- Certain mps.h calls affect it.
- Certain MPS tests use it for more control and reproducibility.
- MPS itself uses it, as part of starting a full collect, for which it must first run any current trace to completion without starting any new ones.
In particular, this set of changes asserts:
MPS ASSERTION FAILURE: ArenaGlobals(arena)->clamped == FALSE
trace.c
534
because mps_arena_collect() tries to start a full collect while clamped.
---
So this changelist is for historical interest only, and will be backed out.
Copied from Perforce
Change: 169853
ServerID: perforce.ravenbrook.com
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
poolamc.c tidy up:
neater implementation of obj1pip (amcReclaimNailed)
neater implementation of amcResetTraceIdStats -- no need for a function any more
delete lots of obsolete temporary diagnostic (superseded by AMCTraceEnd_pageret)
a few more avers (especially on buffer empty)
also revert temporary diagnostic changes in arena.c, config.h, diag.c, global.c
diag.c: fix diag-buffer at 100 screenfuls (200000 chars).
zcoll.c: reinstate Make 50000 with occasional big objs.
Copied from Perforce
Change: 168688
ServerID: perforce.ravenbrook.com
mpmst.h: (comments only) clarify: after all reclaims
pool.c: PoolClassCheck: FUNCHECK(class->traceEnd)
pooln.c: traceEnd method in null pool class
Copied from Perforce
Change: 168687
ServerID: perforce.ravenbrook.com
(introduced in //info.ravenbrook.com/project/mps/branch/2009-03-31/padding/code/zcoll.chttps://github.com/Ravenbrook/mps/issues/4, changelist 168451)
Now that we have two root tables -- Ambig & Exact -- we had better store them in two separate variables! D'oh.
Bug: single variable "root_table" was used for Ambig, and then re-used for Exact. On clear up, only Exact was mps_root-destroyed, and leaving Ambig still around at mps_arena_destroy. In .variety.ci, after ControlFinish, a CHECKL(RingCheck(&arenaGlobals->rootRing)); tries to access the undestoryed root, even though the ControlPool has been unmapped. This causes seg fault. GDB works fine to show this, with bt.
Fix: two vars; call mps_root_destroy on each.
Copied from Perforce
Change: 168533
ServerID: perforce.ravenbrook.com
zcoll:
- parameterize BigdropSmall for big-obj size and small-obj ref-type, eg "BigdropSmall(big 28000, small A)"
- Park, to avoid all those minor collections. Explanatory comments.
poolamc.c:
- diags: AMCTraceEnd, AMCTraceEnd_perc (new), AMCTraceEnd_pad_med (new),
- AMCTraceEnd: c Segs/Pages Whiten/Reclaim, cPagesRet(ained)
- AMCTraceEnd_perc: percentage of condemned pages retained by ambig refs
- AMCTraceEnd_pad_med: over-detailed calculations of Gain & Loss for Medium segs,
requiring knowledge of size of obj1 in each seg.
diag.c:
- Just show AMCTraceEnd_perc and AMCTraceEnd_pad_med, for zcoll/BigdropSmall's purposes.
Note: poolamc.c now has several episodes of experimental diagnostic in it.
It's time to re-baseline it from an un-hacked version.
Copied from Perforce
Change: 168512
ServerID: perforce.ravenbrook.com
Currently: whitenCount & reclaimCount, for diag at AMCTraceEnd.
(These aren't interesting in themselves; next task: calculate more interesting per-trace stats).
Copied from Perforce
Change: 168490
ServerID: perforce.ravenbrook.com
Tracer calls PoolTraceEnd() when the trace is TraceFINISHED.
AbstractPoolClass uses PoolTrivTraceEnd -- a NOOP. [mpm.h, mpmst.h, mpmtypes.h, pool.c, poolabs.c]
AMC overrides with AMCTraceEnd, to emit diagnostic on how well the trace went! [poolamc.c]
Copied from Perforce
Change: 168478
ServerID: perforce.ravenbrook.com
creates a big object and drops the ref to it, followed by a small object and keeps an ambig ref to it (to nail the AMCSeg it is in).
Loops 100 times. This is for testing job001811 changes.
Copied from Perforce
Change: 168451
ServerID: perforce.ravenbrook.com
zcoll.c: BigSmall() command -- creates small, then big, then small object.
poolamc.c: AMCDescribe(): output AMC Seg maps, showing single big object -- a pad -- at end of large-segment.
arena/config/diag: allow output of AMC Seg maps.
Copied from Perforce
Change: 167763
ServerID: perforce.ravenbrook.com
More diag:
- new traceSetSignalEmergency;
- new AMCFix_amcSegCreateNailboard and AMCHeaderFix_amcSegCreateNailboard
(note: the other, unreported, route to becoming boarded is because of a (mutator) buffer);
- in traces: show SegBase and zone;
- in TraceStart: show genZoneSets;
- in amcReclaimNailed: show cbpip and cbpad.
zcoll.c:
- sizemethod 1 to Make command: occasionally makes >1MiB objects;
- declare root_table all MPS_RANK_AMBIG.
Copied from Perforce
Change: 167726
ServerID: perforce.ravenbrook.com