imp = task_faults(env.p, env.dst_nid) - faults;
update_numa_stats(&env.dst_stats, env.dst_nid);
- /*
- * If the preferred nid has capacity then use it. Otherwise find an
- * alternative node with relatively better statistics.
- */
- if (env.dst_stats.has_capacity) {
+ /* If the preferred nid has capacity, try to use it. */
+ if (env.dst_stats.has_capacity)
task_numa_find_cpu(&env, imp);
- } else {
+
+ /* No space available on the preferred nid. Look elsewhere. */
+ if (env.best_cpu == -1) {
for_each_online_node(nid) {
if (nid == env.src_nid || nid == p->numa_preferred_nid)
continue;