1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 00:01:33 -08:00
Commit graph

3710 commits

Author SHA1 Message Date
Richard Kistruck
ec9fd145fb Mps br/vmem arenavm.c: (diagnostic variety only) fix floating point exception after a collection with 0 bytes condemned
The VMCompact diag was calculating the live percentage by dividing by condemned size.  Don't do this if condemned is zero.

Copied from Perforce
 Change: 170441
 ServerID: perforce.ravenbrook.com
2010-04-26 16:06:36 +01:00
Richard Kistruck
fad9fa8edc Mps br/vmem diag.c: version_diag() emits mpsversion in a diag
Copied from Perforce
 Change: 170229
 ServerID: perforce.ravenbrook.com
2010-03-29 16:37:49 +01:00
Richard Kistruck
3ff0a0e582 mps br/vmem: simple-chunk-return:
arenavm.c VMCompact diag: also emit where chunks were gained but not lost during collection -- that is: collections where there was a vmem increase, and ArenaCompact was *not* able to return any chunks.

Copied from Perforce
 Change: 170101
 ServerID: perforce.ravenbrook.com
2010-03-23 08:11:20 +00:00
Richard Kistruck
6e4b89edd2 mps br/vmem: simple-chunk-return:
zcoll.c -- re-enable message timestamp reporting, and BigDropSmall tests (remove ifdefs)

Copied from Perforce
 Change: 170100
 ServerID: perforce.ravenbrook.com
2010-03-23 07:03:38 +00:00
Richard Kistruck
eba5cf1929 mps br/vmem: simple-chunk-return:
readme.txt -- update.
 arenavm.c -- (cosmetic) don't count chunks freed

Copied from Perforce
 Change: 170099
 ServerID: perforce.ravenbrook.com
2010-03-23 06:06:11 +00:00
Richard Kistruck
d1e04a6dd5 mps br/vmem: simple-chunk-return:
arenavm.c, trace.c, mpmst.h -- trace->preTraceArenaReserved, to show pre- and peak-vmem during collection

Copied from Perforce
 Change: 170098
 ServerID: perforce.ravenbrook.com
2010-03-23 04:07:43 +00:00
Richard Kistruck
7bdbbeb2c9 mps br/vmem: simple-chunk-return:
arenavm.c:
   - M_whole, M_frac: print count of bytes as Megabytes
   - diag on VMCompact after all client-requested traces, plus any others where we returned a chunk.
   - show vmem change, and also trace cond, live / % / stuck(pip), notCond

 mpm.c -- new "$3" format for 0-padding 3-char-wide field, for thousandths of a MB

 zcoll.c -- try some new parameters for tests

 diag.c -- just VMCompact diag

Copied from Perforce
 Change: 170097
 ServerID: perforce.ravenbrook.com
2010-03-23 03:52:41 +00:00
Richard Kistruck
7c88915285 Mps br/vmem: arena.c: arenaclasscheck(): funcheck class->compact
Copied from Perforce
 Change: 170096
 ServerID: perforce.ravenbrook.com
2010-03-23 03:24:18 +00:00
Richard Kistruck
0e6aecdbb8 mps br/vmem: simple-chunk-return:
arenavm.c -- move chunk-return into new function "VMCompact".
 (also, in VMArenaFinish, null out arena->primary in VMArenaFinish, so it is not left dangling).

 arena.c, arenavm.c, mpm.h, mpmst.h, mpmtypes.h:
 arena->class->compact: ArenaCompact, ArenaTrivCompact, VMCompact

 trace.c -- traceReclaim calls ArenaCompact!

Copied from Perforce
 Change: 170095
 ServerID: perforce.ravenbrook.com
2010-03-23 01:49:17 +00:00
Richard Kistruck
e3177d0c02 mps br/vmem: simple-chunk-return:
testlib.c (comments only) record dates of changes from v1 -> v2 -> v3 rnd_states.

Copied from Perforce
 Change: 170094
 ServerID: perforce.ravenbrook.com
2010-03-23 00:30:34 +00:00
Richard Kistruck
1ff022cae1 mps br/vmem: simple-chunk-return:
zcoll.c:
 How to get rid of all the objects, so full collect really collects all automatic objects:
   - Rootdrop() helps, but we can still retain a 1.2MB object;
   - stackwipe() does not help much -- these unwanted ambig refs are being left on the stack by MPS code that runs between mps_arena_collect and the flip!
   - therefore StackScan(0/1) to destroy stack+reg root before full collect: it's the only way to be sure.

 Reproducibility:
   - give Make() a random? switch, acted on by df() = diversity function, to allow bypass of rnd();
   - ZRndStateSet, to set the seed for rnd()

 Output:
   - print_M: switchable Mebibytes or Megabytes (more useful, to be honest);
   - get(): don't report message times, it messes up diffs.

 testlib.c/h:
 Reproducibility:
   - fix rnd_state so a rnd_state getter is possible;
   - testlib.h += rnd_state_t, rnd_state(), rnd_state_set(), rnd_state_set_v2()

 trace.c: traceFindGrey diag: no newline please

Copied from Perforce
 Change: 170093
 ServerID: perforce.ravenbrook.com
2010-03-22 23:00:42 +00:00
Richard Kistruck
968eafea90 Mps br/vmem zcoll.c: (tidy) make "make()" a proper function, not inline in the script-decoding switch statement
Copied from Perforce
 Change: 170087
 ServerID: perforce.ravenbrook.com
2010-03-22 14:59:36 +00:00
Richard Kistruck
7078ef1586 mps br/vmem: simple-chunk-return (fix broken compile):
Ooops, remove ALL references to pageTableBase and pageTableLimit fields.

Copied from Perforce
 Change: 170085
 ServerID: perforce.ravenbrook.com
2010-03-22 14:49:11 +00:00
Richard Kistruck
39da284821 mps br/vmem: simple-chunk-return:
tract.c -- fix more ChunkCache defects:
  - drop never-read chunkCache->pageTableBase and pageTableLimit fields: they were used for ChunkOfSeg(), back when each SegStruct was actually a PageStruct is some chunk's PageStructTable; see VMArenaChunkOfSeg() in //info.ravenbrook.com/project/mps/branch/2001-08-13/trunk/src/arenavm.chttps://github.com/Ravenbrook/mps/issues/46
  - there's no need for arena to initialise the chunk cache; this allows en/decache functions to be local to tract.c (ie. declared static)

Copied from Perforce
 Change: 170083
 ServerID: perforce.ravenbrook.com
2010-03-22 13:39:36 +00:00
Richard Kistruck
b75de3e923 mps br/vmem: simple-chunk-return:
arenavm.c --  on VMFree(), destroy any empty chunks (except the primary).  (VMFree is not the ideal place to do it, but works for proof of concept).
 tract.c -- fix ChunkCache defects:
  - previously, if cache is empty (chunkCache->chunk == NULL) then other fields are *undefined*; but code looks at them anyway (!) without first checking chunkCache->chunk;
  - change it (.chunk.empty.fields) so that, if cache is empty, other fields have defined values: cache-using code may look at them, and they are chosen so that no cache hit will occur.
  --> this fixes crashing defect shown by changelist 170072
  - AVERT(ChunkCache) in the many places it should be checked;
  - use AVERT_CRITICAL in ChunkEncache, because it is called by ChunkOfAddr;

 Also:
 plan.txt -- notes on use of primary chunk.
 config.h -- DIAG also in ci, please [Do not integ to master]
 diag.c -- skip ChainCondemnAuto diag thanks
 zcoll.c -- move printf announcing Destroying arena etc to just before, not just after, we do it.

Copied from Perforce
 Change: 170082
 ServerID: perforce.ravenbrook.com
2010-03-22 13:24:49 +00:00
Richard Kistruck
12c0e0bb66 Mps br/vmem plan.txt: import notes on chunk_create
Copied from Perforce
 Change: 170081
 ServerID: perforce.ravenbrook.com
2010-03-22 10:40:00 +00:00
Richard Kistruck
7e68100084 Mps br/vmem: (broken: assert tract.c line 327) run this at variety=ci (ie. where aver_critical works), to show how broken the chunk cache logic is.
Copied from Perforce
 Change: 170072
 ServerID: perforce.ravenbrook.com
2010-03-20 14:05:32 +00:00
Richard Kistruck
e82d034c98 Mps br/vmem: prepare for simple-chunk-return:
arenavm.c: VMFree is okay for testing chunk-ret; though just sparePagesPurge() for now;
  diag.c: show what we want for using zcoll to show chunk-ret:
    VM_ix_Create/Destroy
    TraceStart, excpet only briefly for dyn-crit (why=2) and not at all for minor
  locus.c: no newline on "condemn gens" diag please
  tract.c: ChunkDecache is BROKEN; just add AVER to catch this for now
  vmix.c: VM_ix_Create_ok/VM_ix_Destroy (vmw3.c needs similar)
  zcoll.c:
    release after mps_arena_collect!!!
    make, collect, make, collect, to show chunk-ret
    10MB arena means many chunks
None of this is releaseable quality of course.

Copied from Perforce
 Change: 170071
 ServerID: perforce.ravenbrook.com
2010-03-20 13:51:23 +00:00
Richard Kistruck
0a1201d670 Mps br/vmem: "master" -> "br/vmem"; register at branch/index
Copied from Perforce
 Change: 170012
 ServerID: perforce.ravenbrook.com
2010-03-15 10:10:29 +00:00
Richard Kistruck
0c2e786bc1 Mps br/vmem: branch master sources
Copied from Perforce
 Change: 170011
 ServerID: perforce.ravenbrook.com
2010-03-15 10:02:24 +00:00
Richard Kistruck
c0405ff234 Mps master readme.txt: (minor rewording for clarity in 1.109's change comments)
Copied from Perforce
 Change: 169941
 ServerID: perforce.ravenbrook.com
2010-03-05 13:33:11 +00:00
Richard Kistruck
597f6608ec Mps master: (empty-integ from version/1.109) ignore changes (in index.html, readme.txt) that label version/1.109
Copied from Perforce
 Change: 169938
 ServerID: perforce.ravenbrook.com
2010-03-05 09:07:26 +00:00
Richard Kistruck
a156d700ee Mps version/1.109:
- Register version/1.109
  - 109 index: edit "Master" -> "V 109"
  - 109 readme: delete changes-template from What's New section

Copied from Perforce
 Change: 169936
 ServerID: perforce.ravenbrook.com
2010-03-05 08:58:46 +00:00
Richard Kistruck
808d72888f Mps version/1.109: first integrate from master (populate with files).
Copied from Perforce
 Change: 169934
 ServerID: perforce.ravenbrook.com
2010-03-04 17:27:37 +00:00
Richard Kistruck
54f9da7f9c Mps master: version.c and w3build.bat for release/1.109.0
Copied from Perforce
 Change: 169933
 ServerID: perforce.ravenbrook.com
2010-03-04 17:22:53 +00:00
Richard Kistruck
a6838d12aa Mps master: readme.txt and build-notes for release 1.109
(Also update wiki/timeline.html)

Copied from Perforce
 Change: 169919
 ServerID: perforce.ravenbrook.com
2010-03-03 17:01:50 +00:00
Richard Kistruck
cbd15f9b8e Mps master refman: undocumented += mps_alert_collection_set
Copied from Perforce
 Change: 169918
 ServerID: perforce.ravenbrook.com
2010-03-03 15:48:16 +00:00
Richard Kistruck
c99d28b8da Mps master: design/tests: add zmess.c, zcoll.c. zmess.c subsumes and replaces fin1658a.c.
Copied from Perforce
 Change: 169917
 ServerID: perforce.ravenbrook.com
2010-03-03 15:20:48 +00:00
Richard Kistruck
fb9005a925 Mps master: design/tests: correction: it's fin1658a.c and job001658, not 1638.
Copied from Perforce
 Change: 169915
 ServerID: perforce.ravenbrook.com
2010-03-03 15:12:44 +00:00
Richard Kistruck
81da8f9772 Mps master: add "mps_alert_collection_set" to w3gen.def. (so that if this .def file is used to re-export mps functions from a client executable, mps_alert_collection_set() will be exported, along with all the other mps interface functions).
Copied from Perforce
 Change: 169914
 ServerID: perforce.ravenbrook.com
2010-03-03 15:08:08 +00:00
Richard Kistruck
5ffd337934 Mps master (integ from br/padding): mps_addr_pool(), mps_addr_fmt() -- new mps functions
mps.h, mpsicv.c: implementation
mpsicv.c: new addr_pool_test(), to test them
w3gen.def: export them
walkt0.c: test them within mps_arena_formatted_objects_walk(). (Also checks against values passed to stepper function, and against what we expect).
tool/test-runner.py: add walkt0

Reference Manual: mps_addr_pool, mps_addr_fmt: as yet Undocumented.

Also: design/poolamc: clarifications; add dated attribution for statements by RHSK.

Copied from Perforce
 Change: 169907
 ServerID: perforce.ravenbrook.com
2010-03-02 17:29:41 +00:00
Richard Kistruck
b0df67ea88 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
2010-03-02 17:17:52 +00:00
Richard Kistruck
c0d6b21b4c Mps master (integ from br/padding) tweak to amctraceend_pageret diagnostic
Copied from Perforce
 Change: 169900
 ServerID: perforce.ravenbrook.com
2010-03-02 16:56:08 +00:00
Richard Kistruck
b08097b561 mps master (integ from br/padding): job002148 -- correct w3gen.def:
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
2010-03-02 16:50:07 +00:00
Richard Kistruck
6a0d651629 Amc large segment padding (lsp), for job001811:
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
2010-03-02 16:41:16 +00:00
Richard Kistruck
3aa0a61e67 Mps br/padding refman: mps_addr_pool, mps_addr_fmt: as yet undocumented.
Copied from Perforce
 Change: 169891
 ServerID: perforce.ravenbrook.com
2010-03-02 14:38:50 +00:00
Richard Kistruck
53a7dfe570 Mps br/padding des/poolamc: minor clarifications; date attribution of statements by rhsk
Copied from Perforce
 Change: 169888
 ServerID: perforce.ravenbrook.com
2010-03-02 13:53:36 +00:00
Richard Kistruck
9f1bd289fc Mps br/padding: exp-169863.zip
Copied from Perforce
 Change: 169864
 ServerID: perforce.ravenbrook.com
2010-02-26 17:06:49 +00:00
Richard Kistruck
f2644e8620 Mps br/padding: exp-169863
Copied from Perforce
 Change: 169863
 ServerID: perforce.ravenbrook.com
2010-02-26 16:57:31 +00:00
Richard Kistruck
640b8b5cb8 Mps br/padding (fix w3i3m9 build) mpsi.c: help compiler see format is never uninitialised
Copied from Perforce
 Change: 169862
 ServerID: perforce.ravenbrook.com
2010-02-26 16:56:05 +00:00
Richard Kistruck
e2598917f4 mps br/padding: mps_addr_pool(), mps_addr_fmt() -- new mps functions
mps.h, mpsicv.c: implementation
 mpsicv.c: new addr_pool_test(), to test them
 w3gen.def: export them
 walkt0.c: test them within mps_arena_formatted_objects_walk().  (Also checks against values passed to stepper function, and against what we expect).
 tool/test-runner.py: add walkt0

Copied from Perforce
 Change: 169861
 ServerID: perforce.ravenbrook.com
2010-02-26 16:33:49 +00:00
Richard Kistruck
27df534da7 Mps br/padding arenastep: do not change pollthreshold -- that's for arenapoll, not arenastep.
So ArenaStep may advance, but not retard, trace work.

Copied from Perforce
 Change: 169855
 ServerID: perforce.ravenbrook.com
2010-02-24 16:18:10 +00:00
Richard Kistruck
0540074ccb mps br/padding (back out non-working changelist 169853 (attempt to clear up what "clamped" means))
Copied from Perforce
 Change: 169854
 ServerID: perforce.ravenbrook.com
2010-02-24 16:14:38 +00:00
Richard Kistruck
9c4e0d4265 Mps br/padding (non-working changelist) see whether we can clear up what "clamped" means:
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
2010-02-24 16:07:17 +00:00
Richard Kistruck
deb6058af8 Mps br/padding arenapoll: non-naive fix for j2205: correct updating of pollthreshold, 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 clock().
Copied from Perforce
 Change: 169851
 ServerID: perforce.ravenbrook.com
2010-02-23 13:43:27 +00:00
Richard Kistruck
3fbaab6951 Mps br/padding: exp-169819.zip
Copied from Perforce
 Change: 169820
 ServerID: perforce.ravenbrook.com
2010-02-12 17:31:41 +00:00
Richard Kistruck
dfcf9dde53 mps br/padding: exp-169819: job002205 experimental quick-fix, corrected. delete exp-169816.
Copied from Perforce
 Change: 169819
 ServerID: perforce.ravenbrook.com
2010-02-12 17:23:30 +00:00
Richard Kistruck
ffb0ef749e Mps br/padding: global.c arenapoll: just loop until pollthreshold is past fillmutatorsize. don't be clever. fixes defect in global.cwhere if there was no tracepoll work to do, pollthreshold would not be updated. (ooops).
Copied from Perforce
 Change: 169818
 ServerID: perforce.ravenbrook.com

GitHub-reference: https://github.com/Ravenbrook/mps/issues/4
2010-02-12 17:17:32 +00:00
Richard Kistruck
79bbb26cd5 Mps br/padding: exp-169816
Copied from Perforce
 Change: 169817
 ServerID: perforce.ravenbrook.com
2010-02-12 15:43:14 +00:00
Richard Kistruck
01eb645e2a Mps br/padding: exp-169816: job002205 experimental quick-fix
Copied from Perforce
 Change: 169816
 ServerID: perforce.ravenbrook.com
2010-02-12 15:32:49 +00:00