aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_file_ops.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c
index 9ca582b65fe9..1272aaf2a785 100644
--- a/drivers/infiniband/hw/ipath/ipath_file_ops.c
+++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c
@@ -1592,15 +1592,16 @@ static int find_best_unit(struct file *fp,
1592 */ 1592 */
1593 if (!cpus_empty(current->cpus_allowed) && 1593 if (!cpus_empty(current->cpus_allowed) &&
1594 !cpus_full(current->cpus_allowed)) { 1594 !cpus_full(current->cpus_allowed)) {
1595 int ncpus = num_online_cpus(), curcpu = -1; 1595 int ncpus = num_online_cpus(), curcpu = -1, nset = 0;
1596 for (i = 0; i < ncpus; i++) 1596 for (i = 0; i < ncpus; i++)
1597 if (cpu_isset(i, current->cpus_allowed)) { 1597 if (cpu_isset(i, current->cpus_allowed)) {
1598 ipath_cdbg(PROC, "%s[%u] affinity set for " 1598 ipath_cdbg(PROC, "%s[%u] affinity set for "
1599 "cpu %d\n", current->comm, 1599 "cpu %d/%d\n", current->comm,
1600 current->pid, i); 1600 current->pid, i, ncpus);
1601 curcpu = i; 1601 curcpu = i;
1602 nset++;
1602 } 1603 }
1603 if (curcpu != -1) { 1604 if (curcpu != -1 && nset != ncpus) {
1604 if (npresent) { 1605 if (npresent) {
1605 prefunit = curcpu / (ncpus / npresent); 1606 prefunit = curcpu / (ncpus / npresent);
1606 ipath_cdbg(PROC,"%s[%u] %d chips, %d cpus, " 1607 ipath_cdbg(PROC,"%s[%u] %d chips, %d cpus, "