summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rts/RtsFlags.c7
-rw-r--r--rts/Schedule.c6
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;
}