Commit aae2b3d5 authored by Simon Marlow's avatar Simon Marlow
Browse files

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.
parent 7187deda
......@@ -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)
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment