We can queue all the necessary work without hitting frequent stales now with the time and string stale protection active all the time. This prevents a pool being falsely labelled as not providing work fast enough.
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 44 45 46 47 48 49 50 51 52 53
diff --git a/main.c b/main.c
index 91aff16..17efcdd 100644
--- a/main.c
+++ b/main.c
@@ -2935,19 +2935,11 @@ static bool queue_request(struct thr_info *thr, bool needed)
{
int maxq = opt_queue + mining_threads;
struct workio_cmd *wc;
- int rq, rs;
+ int rq = requests_queued();
- rq = requests_queued();
- rs = requests_staged();
-
- /* If we've been generating lots of local work we may already have
- * enough in the queue */
- if (rq >= maxq || rs >= maxq)
+ if (rq >= maxq)
return true;
- if (rs > rq)
- goto out;
-
/* fill out work request message */
wc = calloc(1, sizeof(*wc));
if (unlikely(!wc)) {
@@ -2964,7 +2956,7 @@ static bool queue_request(struct thr_info *thr, bool needed)
/* 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 */
- if (!rs && rq && needed)
+ if (rq && needed && !requests_staged())
wc->lagging = true;
if (opt_debug)
@@ -2976,7 +2968,7 @@ static bool queue_request(struct thr_info *thr, bool needed)
workio_cmd_free(wc);
return false;
}
-out:
+
inc_queued();
return true;
}
@@ -3093,7 +3085,7 @@ retry:
ret = true;
goto out;
}
- if (requested && requests_queued() > 1 && !pool_tset(pool, &pool->lagging)) {
+ if (requested && !pool_tset(pool, &pool->lagging)) {
applog(LOG_WARNING, "Pool %d not providing work fast enough",
pool->pool_no);
pool->localgen_occasions++;