projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5f9075d
)
Correction to the allocation stats following earlier refactoring
author
Simon Marlow
<marlowsd@gmail.com>
Fri, 4 Dec 2009 11:08:39 +0000
(11:08 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Fri, 4 Dec 2009 11:08:39 +0000
(11:08 +0000)
includes/Cmm.h
patch
|
blob
|
history
includes/mkDerivedConstants.c
patch
|
blob
|
history
includes/rts/storage/GC.h
patch
|
blob
|
history
rts/sm/GC.c
patch
|
blob
|
history
rts/sm/Storage.c
patch
|
blob
|
history
diff --git
a/includes/Cmm.h
b/includes/Cmm.h
index
6d39b45
..
69b5acc
100644
(file)
--- a/
includes/Cmm.h
+++ b/
includes/Cmm.h
@@
-385,7
+385,7
@@
// allocate() - this includes many of the primops.
#define MAYBE_GC(liveness,reentry) \
if (bdescr_link(CurrentNursery) == NULL || \
// allocate() - this includes many of the primops.
#define MAYBE_GC(liveness,reentry) \
if (bdescr_link(CurrentNursery) == NULL || \
- generation_n_large_blocks(W_[g0]) >= CInt[alloc_blocks_lim]) { \
+ generation_n_new_large_blocks(W_[g0]) >= CInt[alloc_blocks_lim]) { \
R9 = liveness; \
R10 = reentry; \
HpAlloc = 0; \
R9 = liveness; \
R10 = reentry; \
HpAlloc = 0; \
diff --git
a/includes/mkDerivedConstants.c
b/includes/mkDerivedConstants.c
index
23a4ecd
..
0f1962c
100644
(file)
--- a/
includes/mkDerivedConstants.c
+++ b/
includes/mkDerivedConstants.c
@@
-249,7
+249,7
@@
main(int argc, char *argv[])
struct_size(generation);
struct_field(generation, mut_list);
struct_size(generation);
struct_field(generation, mut_list);
- struct_field(generation, n_large_blocks);
+ struct_field(generation, n_new_large_blocks);
struct_size(CostCentreStack);
struct_field(CostCentreStack, ccsID);
struct_size(CostCentreStack);
struct_field(CostCentreStack, ccsID);
diff --git
a/includes/rts/storage/GC.h
b/includes/rts/storage/GC.h
index
e7b2e84
..
2a21c66
100644
(file)
--- a/
includes/rts/storage/GC.h
+++ b/
includes/rts/storage/GC.h
@@
-67,10
+67,11
@@
typedef struct generation_ {
bdescr * large_objects; // large objects (doubly linked)
unsigned int n_large_blocks; // no. of blocks used by large objs
bdescr * large_objects; // large objects (doubly linked)
unsigned int n_large_blocks; // no. of blocks used by large objs
+ unsigned int n_new_large_blocks; // count freshly allocated large objects
unsigned int max_blocks; // max blocks
bdescr *mut_list; // mut objects in this gen (not G0)
unsigned int max_blocks; // max blocks
bdescr *mut_list; // mut objects in this gen (not G0)
-
+
StgTSO * threads; // threads in this gen
// linked via global_link
struct generation_ *to; // destination gen for live objects
StgTSO * threads; // threads in this gen
// linked via global_link
struct generation_ *to; // destination gen for live objects
diff --git
a/rts/sm/GC.c
b/rts/sm/GC.c
index
dc4c68f
..
99b0ecc
100644
(file)
--- a/
rts/sm/GC.c
+++ b/
rts/sm/GC.c
@@
-649,6
+649,7
@@
SET_GCT(gc_threads[0]);
freeChain(gen->large_objects);
gen->large_objects = gen->scavenged_large_objects;
gen->n_large_blocks = gen->n_scavenged_large_blocks;
freeChain(gen->large_objects);
gen->large_objects = gen->scavenged_large_objects;
gen->n_large_blocks = gen->n_scavenged_large_blocks;
+ gen->n_new_large_blocks = 0;
ASSERT(countBlocks(gen->large_objects) == gen->n_large_blocks);
}
else // for generations > N
ASSERT(countBlocks(gen->large_objects) == gen->n_large_blocks);
}
else // for generations > N
diff --git
a/rts/sm/Storage.c
b/rts/sm/Storage.c
index
d9c7f86
..
4498bda
100644
(file)
--- a/
rts/sm/Storage.c
+++ b/
rts/sm/Storage.c
@@
-79,6
+79,7
@@
initGeneration (generation *gen, int g)
gen->n_old_blocks = 0;
gen->large_objects = NULL;
gen->n_large_blocks = 0;
gen->n_old_blocks = 0;
gen->large_objects = NULL;
gen->n_large_blocks = 0;
+ gen->n_new_large_blocks = 0;
gen->mut_list = allocBlock();
gen->scavenged_large_objects = NULL;
gen->n_scavenged_large_blocks = 0;
gen->mut_list = allocBlock();
gen->scavenged_large_objects = NULL;
gen->n_scavenged_large_blocks = 0;
@@
-567,6
+568,7
@@
allocate (Capability *cap, lnat n)
bd = allocGroup(req_blocks);
dbl_link_onto(bd, &g0->large_objects);
g0->n_large_blocks += bd->blocks; // might be larger than req_blocks
bd = allocGroup(req_blocks);
dbl_link_onto(bd, &g0->large_objects);
g0->n_large_blocks += bd->blocks; // might be larger than req_blocks
+ g0->n_new_large_blocks += bd->blocks;
RELEASE_SM_LOCK;
initBdescr(bd, g0, g0);
bd->flags = BF_LARGE;
RELEASE_SM_LOCK;
initBdescr(bd, g0, g0);
bd->flags = BF_LARGE;
@@
-666,6
+668,7
@@
allocatePinned (Capability *cap, lnat n)
cap->pinned_object_block = bd = allocBlock();
dbl_link_onto(bd, &g0->large_objects);
g0->n_large_blocks++;
cap->pinned_object_block = bd = allocBlock();
dbl_link_onto(bd, &g0->large_objects);
g0->n_large_blocks++;
+ g0->n_new_large_blocks++;
RELEASE_SM_LOCK;
initBdescr(bd, g0, g0);
bd->flags = BF_PINNED | BF_LARGE;
RELEASE_SM_LOCK;
initBdescr(bd, g0, g0);
bd->flags = BF_PINNED | BF_LARGE;
@@
-784,6
+787,8
@@
calcAllocated( void )
}
}
}
}
+ allocated += g0->n_new_large_blocks * BLOCK_SIZE_W;
+
total_allocated += allocated;
return allocated;
}
total_allocated += allocated;
return allocated;
}