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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
diff --git a/cgminer.c b/cgminer.c
index e824dee..3a9bd22 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");