Gareth Rees
82716d0bd5
Undo change 194718 (merge branch/2016-03-31/page-sparering-elim into the master sources) because of performance regression < https://info.ravenbrook.com/mail/2018/07/29/16-19-19/0/ >
...
Copied from Perforce
Change: 194755
2018-07-29 19:37:31 +01:00
Gareth Rees
4f612b4db0
Merge branch/2016-03-31/page-sparering-elim into the master sources.
...
Copied from Perforce
Change: 194718
2018-07-23 11:57:28 +01:00
Gareth Rees
581c649095
Catch-up merge from master sources at changelevel 194657 to branch/2016-03-30/tract-p-elim.
...
Copied from Perforce
Change: 194661
2018-07-16 09:31:11 +01:00
Gareth Rees
164f0b1214
catch-up merge from master sources at changelevel 194605 to branch/2016-03-30/tract-p-elim.
...
Copied from Perforce
Change: 194617
2018-07-11 21:52:22 +01:00
Gareth Rees
55ec29760b
Catch-up merge from master sources at changelevel 194475 to branch/2016-03-31/page-sparering-elim.
...
Copied from Perforce
Change: 194478
2018-07-06 14:45:20 +01:00
Gareth Rees
825485fa70
Catch-up merge from master sources at changelevel 194456 to branch/2016-03-30/tract-white-elim.
...
Copied from Perforce
Change: 194469
2018-07-06 11:06:20 +01:00
Gareth Rees
d83934de69
Remove return statements that have no effect.
...
Copied from Perforce
Change: 192529
ServerID: perforce.ravenbrook.com
2016-10-13 15:17:50 +01:00
Gareth Rees
e3951fca1e
Add _critical to assertions on the critical path for manual-allocation-bound programs using mvff. this brings the hot/rash ratio for "djbench mvff" down from over 150% to about 130%.
...
Copied from Perforce
Change: 192148
ServerID: perforce.ravenbrook.com
2016-09-04 19:20:05 +01:00
Richard Brooksby
4be15a5b0b
Catch-up merge from master sources to branch/2016-04-08/protidying.
...
Copied from Perforce
Change: 191471
ServerID: perforce.ravenbrook.com
2016-04-21 14:46:10 +01:00
Gareth Rees
2df530bb62
Make it clear where tags are defined and where they are referenced, as suggested by rb in review.
...
Copied from Perforce
Change: 191288
ServerID: perforce.ravenbrook.com
2016-04-19 19:24:46 +01:00
Gareth Rees
13ec8a0e2c
When growing an arena: (i) don't create a chunk that's too small for the allocation that's going to follow; (ii) don't create a chunk that's larger than necessary.
...
Copied from Perforce
Change: 190952
ServerID: perforce.ravenbrook.com
2016-04-11 20:33:38 +01:00
Gareth Rees
86c96d8455
Assert that the range passed to landinsert is not empty.
...
Assert that the range passed to ArenaFreeLandInsert is not empty.
Assert that there's address space left over in a chunk after the overheads have been accounted for.
Copied from Perforce
Change: 190920
ServerID: perforce.ravenbrook.com
2016-04-11 16:09:51 +01:00
Richard Brooksby
cf29dcc98d
Making arenas properly inherit from instances, and converting remaining method calls to use the method macro, while noting uses which are inside-out.
...
Copied from Perforce
Change: 190856
ServerID: perforce.ravenbrook.com
2016-04-10 14:00:55 +01:00
Richard Brooksby
e146cbf0b1
Moving the vm arena's spare ring nodes into the spare pages themselves, allowing the size of page descriptors to be reduced.
...
Copied from Perforce
Change: 190590
ServerID: perforce.ravenbrook.com
2016-03-31 19:38:31 +01:00
Richard Brooksby
82696dfe78
Replacing tract->p with tract->seg.
...
Copied from Perforce
Change: 190561
ServerID: perforce.ravenbrook.com
2016-03-30 17:56:49 +01:00
Richard Brooksby
c241cca8a5
Removing white field from tracts.
...
Copied from Perforce
Change: 190536
ServerID: perforce.ravenbrook.com
2016-03-30 15:36:18 +01:00
Gareth Rees
72209444c0
Store reserved address space associated with chunk in a field in the chunkstruct, as suggested by rb in < https://info.ravenbrook.com/mail/2014/10/01/13-55-44/0/ >.
...
Copied from Perforce
Change: 187104
ServerID: perforce.ravenbrook.com
2014-10-01 21:40:50 +01:00
Gareth Rees
53c5301a9e
Instead of iterating over the chunks to compute the total reserved address space, maintain a running total in arenachunkinsert and (new function) arenachunkremoved.
...
New arena class method chunkReserved handles the class-specific computation of the reserved size of a chunk.
Copied from Perforce
Change: 187089
ServerID: perforce.ravenbrook.com
2014-09-29 22:50:46 +01:00
Gareth Rees
83a93881a2
Design.mps.ring.naming: "when one structure parent contains one ring of child structures, the field in parent is usually known as childring, and the field in child is known as parentring". so the field in chunkstruct should be named arenaring.
...
Copied from Perforce
Change: 187084
ServerID: perforce.ravenbrook.com
2014-09-29 20:54:00 +01:00
Gareth Rees
c968255f1e
Ensure that code of the form if (condition) statement; is split over two lines, so that it is possible to set a breakpoint on the statement in a debugger.
...
This change was agreed in 1997 (see <https://info.ravenbrook.com/project/mps/mail/1997/08/19/13-44/0.txt >), so it's about time it was implemented.
Copied from Perforce
Change: 187071
ServerID: perforce.ravenbrook.com
2014-09-27 22:57:02 +01:00
Gareth Rees
1608519fe2
Fix problems identified by nb in review < https://info.ravenbrook.com/mail/2014/07/24/12-21-04/0/ >.
...
Copied from Perforce
Change: 186945
ServerID: perforce.ravenbrook.com
2014-08-06 16:18:34 +01:00
Gareth Rees
07912c0833
Fix problems noted by dl in review < https://info.ravenbrook.com/mail/2014/06/17/13-35-38/0/ >.
...
Copied from Perforce
Change: 186662
ServerID: perforce.ravenbrook.com
2014-06-17 15:15:32 +01:00
Gareth Rees
3aba0f32d9
Catch-up merge from master sources @186573 to branch/2014-05-28/align.
...
Copied from Perforce
Change: 186631
ServerID: perforce.ravenbrook.com
2014-06-14 16:11:20 +01:00
Gareth Rees
33b3eec69d
More modular to assign the primary chunk in arenachunkinsert.
...
Copied from Perforce
Change: 186621
ServerID: perforce.ravenbrook.com
2014-06-14 14:34:10 +01:00
Gareth Rees
8ecf6264f4
Configurable grain size for client arenas.
...
Copied from Perforce
Change: 186579
ServerID: perforce.ravenbrook.com
2014-06-13 16:24:55 +01:00
Gareth Rees
8b012960dc
Some assertions with && crept back in. split them up so that we get as much information as possible from an assertion failure.
...
Copied from Perforce
Change: 186577
ServerID: perforce.ravenbrook.com
2014-06-13 15:52:50 +01:00
Gareth Rees
a13a1aa1df
Catch-up merge from master sources @186564 to branch/2014-06-11/grain.
...
Copied from Perforce
Change: 186572
ServerID: perforce.ravenbrook.com
2014-06-13 15:30:46 +01:00
Gareth Rees
100405cac2
Restore the chunk ring.
...
Copied from Perforce
Change: 186558
ServerID: perforce.ravenbrook.com
2014-06-13 12:31:47 +01:00
Gareth Rees
b240945cb9
Tract iteration interface is only used by the arena coverage test, so move it out of tract.c and into arenacv.c.
...
Copied from Perforce
Change: 186548
ServerID: perforce.ravenbrook.com
2014-06-12 19:06:10 +01:00
Gareth Rees
1d9afa915f
Fix arenadescribetracts:
...
* Return value from TreeVisitor is Bool, not Res, so pass Res back via a closure.
* Can't use TRACT_TRACT_FOR while iterating over the chunk tree, because that macro uses ChunkOfAddr. (A plain loop is simpler.)
* Mustn't try to describe unallocated tracts -- they might not even be mapped into memory. So consult the allocTable.
Make tract functions more robust:
* TractCheck must only check the pool if there is one (otherwise it segfaults for unallocated tracts)
* TractLimit can't look up the arena via TractPool, because the tract might not have a pool. So pass in the arena as an argument.
Copied from Perforce
Change: 186547
ServerID: perforce.ravenbrook.com
2014-06-12 18:46:49 +01:00
Gareth Rees
08f341fcc9
Catch-up merge from master sources @186540 to branch/2014-05-17/chunk-tree.
...
Copied from Perforce
Change: 186546
ServerID: perforce.ravenbrook.com
2014-06-12 17:55:16 +01:00
Gareth Rees
bfb0b771dd
Rename "arena alignment" to "arena grain size" to avoid confusion with ordinary structure alignment.
...
Copied from Perforce
Change: 186503
ServerID: perforce.ravenbrook.com
2014-06-11 17:13:03 +01:00
Gareth Rees
de2a30d207
Catch-up merge from master sources @186481 to branch/2014-05-17/chunk-tree.
...
Copied from Perforce
Change: 186491
ServerID: perforce.ravenbrook.com
2014-06-11 13:52:31 +01:00
Gareth Rees
2087688964
Fix problems identified by rb in review < https://info.ravenbrook.com/mail/2014/06/05/14-58-24/0/ >.
...
Copied from Perforce
Change: 186451
ServerID: perforce.ravenbrook.com
2014-06-08 22:10:21 +01:00
Gareth Rees
220e23a758
Fix problems identified by dl in review < https://info.ravenbrook.com/mail/2014/06/05/14-49-13/0/ >.
...
Copied from Perforce
Change: 186445
ServerID: perforce.ravenbrook.com
2014-06-08 17:45:44 +01:00
Gareth Rees
2f0ef9355d
Clarify tracefix logic by unwinding the nested conditions.
...
Change the arena's chunk tree from a splay tree to an ordinary tree (so that it's not possible to accidentally splay it and leave it unbalanced).
New function TreeFindNext allows us to implement TractFirst and TractNext without having to splay the tree.
Make sure all operations on the chunk tree leave it balanced. But don't balance the tree directly in ChunkFinish() because this is only ever called in a loop where multiple chunks are being deleted from the tre. Instead use the sequence TreeToVine -- iterate and delete -- TreeBalance. The new macro TREE_DESTROY assists with this.
No need any more for ArenaIsReservedAddr, CHUNK_OF_ADDR, TRACT_OF_ADDR.
Update design documentation.
Copied from Perforce
Change: 186212
ServerID: perforce.ravenbrook.com
2014-05-20 18:12:37 +01:00
Gareth Rees
47befaa46b
Use treefind instead of splaytreefind to search the chunk tree.
...
Balance the chunk tree after insertion and deletion.
Avoid calling TractFirst and TractNext in ArenaDescribeTracts and PoolOfRange.
Copied from Perforce
Change: 186199
ServerID: perforce.ravenbrook.com
2014-05-19 20:19:50 +01:00
Gareth Rees
632ac692a5
Restore "avoid" mechanism in arenaallocpage.
...
Make sure that we can tear down the arena if ArenaCreate fails:
1. Don't set hasFreeCBS until the block pool has some pages.
2. Finish the CBS block pool in ArenaFinish, not ArenaDestroy.
3. Delete the chunk from the arena's free CBS before destroying the chunk, just in case the chunk contains pages from the CBS's block pool.
Copied from Perforce
Change: 186177
ServerID: perforce.ravenbrook.com
2014-05-19 12:24:11 +01:00
Gareth Rees
0b0a465674
Replace the chunk ring with a chunk tree.
...
Fix bug in SplayFindNext (LESS and GREATER the wrong way round).
Copied from Perforce
Change: 186157
ServerID: perforce.ravenbrook.com
2014-05-17 17:05:42 +01:00
Gareth Rees
4b5d396792
Catch-up merge from master sources to branch/2014-03-30/addrset.
...
Copied from Perforce
Change: 185288
ServerID: perforce.ravenbrook.com
2014-04-07 15:02:09 +01:00
Gareth Rees
d3d2795fce
Improve control over checking:
...
1. Where Type is a pointer type with a signature, replace CHECKL(TypeCheck(val)) with CHECKD(Type, val).
2. Where Type is a pointer type with no signature, replace CHECKL(TypeCheck(val)) with CHECKD_NOSIG(Type, val).
3. Where Type is a pointer type with a signature, but the structure is not visible at point of checking, replace CHECKL(TypeCheck(val)) with CHECKD_NOSIG(Type, val). Reference <design/check/#.hidden-type>
4. Make BTCheck extern and use it where possible.
5. Replace AVER(TypeCheck(val)) with AVERT(Type, val).
Copied from Perforce
Change: 185263
ServerID: perforce.ravenbrook.com
2014-04-06 22:51:05 +01:00
Gareth Rees
d2cbfda452
First pass at implementation of lands (collections of address ranges). 100% boilerplate!
...
Copied from Perforce
Change: 185131
ServerID: perforce.ravenbrook.com
2014-04-01 19:51:55 +01:00
Richard Brooksby
d1473656ee
Resolving questions left behind in fixmes.
...
Copied from Perforce
Change: 184609
ServerID: perforce.ravenbrook.com
2014-02-28 14:42:44 +00:00
Richard Brooksby
460f988a46
Removing the freering allocation cache, which breaks the cbs abstraction and does not give any benefit once we’re allocating from zonecbss.
...
Copied from Perforce
Change: 184529
ServerID: perforce.ravenbrook.com
2014-02-25 11:35:18 +00:00
Richard Brooksby
2151d00c7f
Catch-up merge from master, mainly to pick up spare-ring merge.
...
Copied from Perforce
Change: 184365
ServerID: perforce.ravenbrook.com
2014-02-18 13:47:49 +00:00
Richard Brooksby
4fc8971802
Minor updates in response to review. see https://info.ravenbrook.com/mail/2014/02/17/16-27-18/0/
...
Copied from Perforce
Change: 184354
ServerID: perforce.ravenbrook.com
2014-02-17 16:45:12 +00:00
Richard Brooksby
bc47522ae2
Abstracting partially mapped page tables into a sparsearray abstract datatype, removing a great deal of complexity from the vm arena, and some unnecessary double-initialisation and scanning loops during allocation.
...
Copied from Perforce
Change: 184333
ServerID: perforce.ravenbrook.com
2014-02-12 17:32:20 +00:00
Richard Brooksby
f1d5750639
Adding a cache of free pages per zone to the arena, so that we recycle single pages fast, especially after each reclaim.
...
Copied from Perforce
Change: 184324
ServerID: perforce.ravenbrook.com
2014-02-11 15:23:32 +00:00
Richard Brooksby
9bc635b24d
Further tidying up of the page descriptor and naming.
...
Copied from Perforce
Change: 184323
ServerID: perforce.ravenbrook.com
2014-02-11 14:14:16 +00:00
Richard Brooksby
f9e9805b39
Encoding the page state in the bottom two bits of the first field, rather than using up a whole word, in order to make room for a free list pointer.
...
Copied from Perforce
Change: 184322
ServerID: perforce.ravenbrook.com
2014-02-11 13:41:57 +00:00