|
@@ -5004,30 +5004,17 @@ static bool work_rollable(struct work *work)
|
|
|
static bool hash_push(struct work *work)
|
|
static bool hash_push(struct work *work)
|
|
|
{
|
|
{
|
|
|
bool rc = true;
|
|
bool rc = true;
|
|
|
- bool was_empty;
|
|
|
|
|
|
|
|
|
|
mutex_lock(stgd_lock);
|
|
mutex_lock(stgd_lock);
|
|
|
if (work_rollable(work))
|
|
if (work_rollable(work))
|
|
|
staged_rollable++;
|
|
staged_rollable++;
|
|
|
if (likely(!getq->frozen)) {
|
|
if (likely(!getq->frozen)) {
|
|
|
- was_empty = unlikely(staged_full && !HASH_COUNT(staged_work));
|
|
|
|
|
HASH_ADD_INT(staged_work, id, work);
|
|
HASH_ADD_INT(staged_work, id, work);
|
|
|
HASH_SORT(staged_work, tv_sort);
|
|
HASH_SORT(staged_work, tv_sort);
|
|
|
} else
|
|
} else
|
|
|
rc = false;
|
|
rc = false;
|
|
|
pthread_cond_broadcast(&getq->cond);
|
|
pthread_cond_broadcast(&getq->cond);
|
|
|
mutex_unlock(stgd_lock);
|
|
mutex_unlock(stgd_lock);
|
|
|
-
|
|
|
|
|
- if (unlikely(was_empty))
|
|
|
|
|
- {
|
|
|
|
|
- if (likely(opt_queue < 10 + mining_threads))
|
|
|
|
|
- {
|
|
|
|
|
- ++opt_queue;
|
|
|
|
|
- applog(LOG_WARNING, "Staged work underrun; increasing queue minimum to %d", opt_queue);
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- applog(LOG_WARNING, "Staged work underrun; not automatically increasing above %d", opt_queue);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
return rc;
|
|
return rc;
|
|
|
}
|
|
}
|
|
@@ -6972,7 +6959,19 @@ static struct work *hash_pop(void)
|
|
|
retry:
|
|
retry:
|
|
|
mutex_lock(stgd_lock);
|
|
mutex_lock(stgd_lock);
|
|
|
while (!getq->frozen && !HASH_COUNT(staged_work))
|
|
while (!getq->frozen && !HASH_COUNT(staged_work))
|
|
|
|
|
+ {
|
|
|
|
|
+ if (unlikely(staged_full))
|
|
|
|
|
+ {
|
|
|
|
|
+ if (likely(opt_queue < 10 + mining_threads))
|
|
|
|
|
+ {
|
|
|
|
|
+ ++opt_queue;
|
|
|
|
|
+ applog(LOG_WARNING, "Staged work underrun; increasing queue minimum to %d", opt_queue);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ applog(LOG_WARNING, "Staged work underrun; not automatically increasing above %d", opt_queue);
|
|
|
|
|
+ }
|
|
|
pthread_cond_wait(&getq->cond, stgd_lock);
|
|
pthread_cond_wait(&getq->cond, stgd_lock);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
hc = HASH_COUNT(staged_work);
|
|
hc = HASH_COUNT(staged_work);
|
|
|
/* Find clone work if possible, to allow masters to be reused */
|
|
/* Find clone work if possible, to allow masters to be reused */
|