mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 10:04:33 +00:00
Only report threads in and out in queued work devices across a get work since the rest happens asynchronously and the get work is what the device might be waiting on.
This commit is contained in:
parent
b12badc9f2
commit
cbea0a5306
11
cgminer.c
11
cgminer.c
@ -4665,6 +4665,10 @@ static void *api_thread(void *userdata)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Sole work devices are serialised wrt calling get_work so they report in on
|
||||||
|
* each pass through their scanhash function as well as in get_work whereas
|
||||||
|
* queued work devices work asynchronously so get them to report in and out
|
||||||
|
* only across get_work. */
|
||||||
static void thread_reportin(struct thr_info *thr)
|
static void thread_reportin(struct thr_info *thr)
|
||||||
{
|
{
|
||||||
thr->getwork = false;
|
thr->getwork = false;
|
||||||
@ -5668,6 +5672,7 @@ static struct work *get_work(struct thr_info *thr, const int thr_id)
|
|||||||
{
|
{
|
||||||
struct work *work = NULL;
|
struct work *work = NULL;
|
||||||
|
|
||||||
|
thread_reportout(thr);
|
||||||
applog(LOG_DEBUG, "Popping work from get queue to get work");
|
applog(LOG_DEBUG, "Popping work from get queue to get work");
|
||||||
while (!work) {
|
while (!work) {
|
||||||
work = hash_pop();
|
work = hash_pop();
|
||||||
@ -5783,8 +5788,6 @@ bool submit_nonce(struct thr_info *thr, struct work *work, uint32_t nonce)
|
|||||||
|
|
||||||
submit_work_async(work, &tv_work_found);
|
submit_work_async(work, &tv_work_found);
|
||||||
out:
|
out:
|
||||||
thread_reportin(thr);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6132,9 +6135,7 @@ void hash_queued_work(struct thr_info *mythr)
|
|||||||
|
|
||||||
fill_queue(mythr, cgpu, drv, thr_id);
|
fill_queue(mythr, cgpu, drv, thr_id);
|
||||||
|
|
||||||
thread_reportin(mythr);
|
|
||||||
hashes = drv->scanwork(mythr);
|
hashes = drv->scanwork(mythr);
|
||||||
thread_reportout(mythr);
|
|
||||||
|
|
||||||
if (unlikely(hashes == -1 )) {
|
if (unlikely(hashes == -1 )) {
|
||||||
applog(LOG_ERR, "%s %d failure, disabling!", drv->name, cgpu->device_id);
|
applog(LOG_ERR, "%s %d failure, disabling!", drv->name, cgpu->device_id);
|
||||||
@ -6176,12 +6177,12 @@ void *miner_thread(void *userdata)
|
|||||||
snprintf(threadname, 24, "miner/%d", thr_id);
|
snprintf(threadname, 24, "miner/%d", thr_id);
|
||||||
RenameThread(threadname);
|
RenameThread(threadname);
|
||||||
|
|
||||||
|
thread_reportout(mythr);
|
||||||
if (!drv->thread_init(mythr)) {
|
if (!drv->thread_init(mythr)) {
|
||||||
dev_error(cgpu, REASON_THREAD_FAIL_INIT);
|
dev_error(cgpu, REASON_THREAD_FAIL_INIT);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
thread_reportout(mythr);
|
|
||||||
applog(LOG_DEBUG, "Waiting on sem in miner thread");
|
applog(LOG_DEBUG, "Waiting on sem in miner thread");
|
||||||
cgsem_wait(&mythr->sem);
|
cgsem_wait(&mythr->sem);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user