imbalance = (max_load - nr_running) / 2;
/* It needs an at least ~25% imbalance to trigger balancing. */
if (!idle && (imbalance < (max_load + 3)/4))
return;
nr_running = double_lock_balance(this_rq, busiest, this_cpu, idle, nr_running);
/*
* Make sure nothing changed since we checked the
* runqueue length.
*/
if (busiest->nr_running <= this_rq->nr_running + 1)
goto out_unlock;
In the last if statement above, I suspect we want to compare
'busiest->nr_running' to the local variable nr_running (as was
done in previous versions of the code). If this is not the
case, then we can simplify double_lock_balance() and make it
return a void.
P.S. I've only been working with the 2.4.17 version of the patch,
but I assume the code is the same in other versions.
-- Mike - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/