|
|
@@ -4042,7 +4042,7 @@ out:
|
|
|
}
|
|
|
|
|
|
/* Specifies whether we can use this pool for work or not. */
|
|
|
-static bool pool_unworkable(struct pool *pool)
|
|
|
+static bool pool_unworkable(const struct pool * const pool)
|
|
|
{
|
|
|
if (pool->idle)
|
|
|
return true;
|
|
|
@@ -4053,6 +4053,18 @@ static bool pool_unworkable(struct pool *pool)
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+static
|
|
|
+bool pool_actively_in_use(const struct pool * const pool, const struct pool *cp)
|
|
|
+{
|
|
|
+ if (pool_unworkable(pool))
|
|
|
+ return false;
|
|
|
+ if (pool_strategy == POOL_LOADBALANCE || pool_strategy == POOL_BALANCE)
|
|
|
+ return true;
|
|
|
+ if (!cp)
|
|
|
+ cp = current_pool();
|
|
|
+ return (pool == cp);
|
|
|
+}
|
|
|
+
|
|
|
/* In balanced mode, the amount of diff1 solutions per pool is monitored as a
|
|
|
* rolling average per 10 minutes and if pools start getting more, it biases
|
|
|
* away from them to distribute work evenly. The share count is reset to the
|