|
|
|
@ -7121,6 +7121,7 @@ static void *watchpool_thread(void __maybe_unused *userdata)
@@ -7121,6 +7121,7 @@ static void *watchpool_thread(void __maybe_unused *userdata)
|
|
|
|
|
|
|
|
|
|
/* Get a rolling utility per pool over 10 mins */ |
|
|
|
|
if (intervals > 19) { |
|
|
|
|
applog(LOG_DEBUG, "Getting rolling utility for %s", pool->poolname); |
|
|
|
|
int shares = pool->diff1 - pool->last_shares; |
|
|
|
|
|
|
|
|
|
pool->last_shares = pool->diff1; |
|
|
|
@ -7128,18 +7129,22 @@ static void *watchpool_thread(void __maybe_unused *userdata)
@@ -7128,18 +7129,22 @@ static void *watchpool_thread(void __maybe_unused *userdata)
|
|
|
|
|
pool->shares = pool->utility; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (pool->state == POOL_DISABLED) |
|
|
|
|
if (pool->state == POOL_DISABLED) { |
|
|
|
|
applog(LOG_DEBUG, "Skipping disabled %s", pool->poolname); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Don't start testing any pools if the test threads
|
|
|
|
|
* from startup are still doing their first attempt. */ |
|
|
|
|
if (unlikely(pool->testing)) { |
|
|
|
|
applog(LOG_DEBUG, "Testing %s", pool->poolname); |
|
|
|
|
pthread_join(pool->test_thread, NULL); |
|
|
|
|
pool->testing = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Test pool is idle once every minute */ |
|
|
|
|
if (pool->idle && now.tv_sec - pool->tv_idle.tv_sec > 30) { |
|
|
|
|
applog(LOG_DEBUG, "Testing idle %s", pool->poolname); |
|
|
|
|
cgtime(&pool->tv_idle); |
|
|
|
|
if (pool_active(pool, true) && pool_tclear(pool, &pool->idle)) |
|
|
|
|
pool_resus(pool); |
|
|
|
@ -7156,8 +7161,10 @@ static void *watchpool_thread(void __maybe_unused *userdata)
@@ -7156,8 +7161,10 @@ static void *watchpool_thread(void __maybe_unused *userdata)
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (current_pool()->idle) |
|
|
|
|
if (current_pool()->idle) { |
|
|
|
|
applog(LOG_DEBUG, "%s is idle, switching pools", current_pool()->poolname); |
|
|
|
|
switch_pools(NULL); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (pool_strategy == POOL_ROTATE && now.tv_sec - rotate_tv.tv_sec > 60 * opt_rotate_period) { |
|
|
|
|
cgtime(&rotate_tv); |
|
|
|
|