diff options
author | Simon Marlow <marlowsd@gmail.com> | 2016-10-28 16:34:44 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2016-10-28 20:14:41 +0100 |
commit | aae2b3d522aae49311a9f9c52d40fb58c99eed13 (patch) | |
tree | 75a592b689125fa12d942eca925a57d28a15a3e7 /rts | |
parent | 7187dedabec8e01394578c9f40241ca3d644a4f8 (diff) | |
download | haskell-aae2b3d522aae49311a9f9c52d40fb58c99eed13.tar.gz |
Make it possible to use +RTS -qn without -N
It's entirely reasonable to set +RTS -qn without setting -N, because the
program might later call setNumCapabilities. If we disallow it, there's
no way to use -qn on programs that use setNumCapabilities.
Diffstat (limited to 'rts')
-rw-r--r-- | rts/RtsFlags.c | 7 | ||||
-rw-r--r-- | rts/Schedule.c | 6 |
2 files changed, 5 insertions, 8 deletions
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index d86b154342..aeb2fe532f 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -1487,13 +1487,6 @@ static void normaliseRtsOpts (void) RtsFlags.ParFlags.parGcLoadBalancingGen = 1; } } - -#ifdef THREADED_RTS - if (RtsFlags.ParFlags.parGcThreads > RtsFlags.ParFlags.nCapabilities) { - errorBelch("GC threads (-qn) must be between 1 and the value of -N"); - errorUsage(); - } -#endif } static void errorUsage (void) diff --git a/rts/Schedule.c b/rts/Schedule.c index 06db3fe81f..a44512b3cb 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -1596,7 +1596,11 @@ scheduleDoGC (Capability **pcap, Task *task USED_IF_THREADS, // enabled_capabilities may change if requestSync() below fails and // we retry. if (gc_type == SYNC_GC_PAR && n_gc_threads > 0) { - need_idle = stg_max(0, enabled_capabilities - n_gc_threads); + if (n_gc_threads >= enabled_capabilities) { + need_idle = 0; + } else { + need_idle = enabled_capabilities - n_gc_threads; + } } else { need_idle = 0; } |