summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2016-04-09 20:45:50 +0100
committerSimon Marlow <smarlow@fb.com>2016-05-04 05:30:30 -0700
commit76ee260778991367b8dbf07ecf7afd31f826c824 (patch)
treefbddddf878413dab3c01abf8108c26d2bd20db4c /includes
parentf9d93751126e58fb990335095e02fd81a3595fde (diff)
downloadhaskell-76ee260778991367b8dbf07ecf7afd31f826c824.tar.gz
Allow limiting the number of GC threads (+RTS -qn<n>)
This allows the GC to use fewer threads than the number of capabilities. At each GC, we choose some of the capabilities to be "idle", which means that the thread running on that capability (if any) will sleep for the duration of the GC, and the other threads will do its work. We choose capabilities that are already idle (if any) to be the idle capabilities. The idea is that this helps in the following situation: * We want to use a large -N value so as to make use of hyperthreaded cores * We use a large heap size, so GC is infrequent * But we don't want to use all -N threads in the GC, because that thrashes the memory too much. See docs for usage.
Diffstat (limited to 'includes')
-rw-r--r--includes/rts/Flags.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/includes/rts/Flags.h b/includes/rts/Flags.h
index 9321b4d160..16417ce34e 100644
--- a/includes/rts/Flags.h
+++ b/includes/rts/Flags.h
@@ -203,6 +203,10 @@ typedef struct _PAR_FLAGS {
* non-load-balancing parallel GC.
* (zero disables) */
+ nat parGcThreads;
+ /* Use this many threads for parallel
+ * GC (default: use all nNodes). */
+
rtsBool setAffinity; /* force thread affinity with CPUs */
} PAR_FLAGS;
#endif /* THREADED_RTS */