From 1a041668a59beceadc980a28d939db974a973dae Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 5 Aug 2012 14:37:49 +1000 Subject: [PATCH] Reinstate check for system queueing lag when the current pool's queue is maxed out, there is no staged work, and the work is needed now. --- cgminer.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/cgminer.c b/cgminer.c index e824dee2..3a9bd229 100644 --- a/cgminer.c +++ b/cgminer.c @@ -3712,17 +3712,25 @@ bool queue_request(struct thr_info *thr, bool needed) { int cq, cs, ts, tq, maxq = opt_queue + mining_threads; struct workio_cmd *wc; + bool lag = false; cq = current_queued(); cs = current_staged(); ts = total_staged(); tq = global_queued(); - /* Test to make sure we have enough work for pools without rolltime - * and enough original work for pools with rolltime */ - if (((cs || cq >= opt_queue) && ts >= maxq) || - ((cs || cq) && tq >= maxq)) - return true; + if (needed && cq >= maxq && !ts && !opt_fail_only) { + /* If we're queueing work faster than we can stage it, consider + * the system lagging and allow work to be gathered from + * another pool if possible */ + lag = true; + } else { + /* Test to make sure we have enough work for pools without rolltime + * and enough original work for pools with rolltime */ + if (((cs || cq >= opt_queue) && ts >= maxq) || + ((cs || cq) && tq >= maxq)) + return true; + } /* fill out work request message */ wc = calloc(1, sizeof(*wc)); @@ -3733,6 +3741,7 @@ bool queue_request(struct thr_info *thr, bool needed) wc->cmd = WC_GET_WORK; wc->thr = thr; + wc->lagging = lag; applog(LOG_DEBUG, "Queueing getwork request to work thread");