[svn:parrot] r44142 - trunk/src/gc
chromatic at svn.parrot.org
chromatic at svn.parrot.org
Thu Feb 18 19:50:07 UTC 2010
Author: chromatic
Date: Thu Feb 18 19:50:06 2010
New Revision: 44142
URL: https://trac.parrot.org/parrot/changeset/44142
Log:
[GC] Tuned the GC tuning commit of r43939 so that pools which have exceeded
their maximum arena size now always cause a GC run when they run out of free
headers. This answers the question "Who tunes the tuners?" Unfortunately,
it's me, when #perl6 notices.
Modified:
trunk/src/gc/gc_ms.c
trunk/src/gc/gc_private.h
Modified: trunk/src/gc/gc_ms.c
==============================================================================
--- trunk/src/gc/gc_ms.c Thu Feb 18 19:38:51 2010 (r44141)
+++ trunk/src/gc/gc_ms.c Thu Feb 18 19:50:06 2010 (r44142)
@@ -471,6 +471,7 @@
/* Note it */
mem_pools->gc_mark_runs++;
--mem_pools->gc_mark_block_level;
+ mem_pools->header_allocs_since_last_collect = 0;
return;
}
@@ -1154,8 +1155,9 @@
if (pool->skip == GC_ONE_SKIP)
pool->skip = GC_NO_SKIP;
- else if (pool->skip == GC_NO_SKIP
- && interp->mem_pools->header_allocs_since_last_collect >= 1024*1024)
+ else if (pool->skip == GC_NEVER_SKIP
+ || (pool->skip == GC_NO_SKIP
+ && mem_pools->header_allocs_since_last_collect >= GC_SIZE_THRESHOLD))
Parrot_gc_mark_and_sweep(interp, GC_trace_stack_FLAG);
/* requires that num_free_objects be updated in Parrot_gc_mark_and_sweep.
@@ -1318,6 +1320,9 @@
if (alloc_size > POOL_MAX_BYTES)
pool->objects_per_alloc = POOL_MAX_BYTES / pool->object_size;
+
+ if (alloc_size > GC_SIZE_THRESHOLD)
+ pool->skip = GC_NEVER_SKIP;
}
Modified: trunk/src/gc/gc_private.h
==============================================================================
--- trunk/src/gc/gc_private.h Thu Feb 18 19:38:51 2010 (r44141)
+++ trunk/src/gc/gc_private.h Thu Feb 18 19:50:06 2010 (r44142)
@@ -45,6 +45,7 @@
#define UNITS_PER_ALLOC_GROWTH_FACTOR 1.75
#define POOL_MAX_BYTES 65536 * 128
+#define GC_SIZE_THRESHOLD 1024 * 1024
#define PMC_HEADERS_PER_ALLOC 4096 * 10 / sizeof (PMC)
#define BUFFER_HEADERS_PER_ALLOC 4096 / sizeof (Buffer)
@@ -91,7 +92,8 @@
typedef enum _gc_skip_type_enum {
GC_NO_SKIP = 0,
GC_ONE_SKIP,
- GC_ALWAYS_SKIP
+ GC_ALWAYS_SKIP,
+ GC_NEVER_SKIP
} gc_skip_type_enum;
typedef struct GC_Subsystem {
More information about the parrot-commits
mailing list