Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f0810daf74c564a3615eba5002cc11c21a0949ba
Commit:     f0810daf74c564a3615eba5002cc11c21a0949ba
Parent:     662af5813be9aadf95ca310b7b6d1d37070c9922
Author:     Bryan O'Sullivan <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 15 14:45:13 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Wed Apr 18 20:20:59 2007 -0700

    IB/ipath: Fix unit selection when all CPU affinity bits set
    
    At some point things changed so that all the affinity bits can be set,
    but cpus_full() macro is not true.  This caused problems with the unit
    selection logic on multi-unit (board) configurations.
    
    Signed-off-by: Dave Olson <[EMAIL PROTECTED]>
    Signed-off-by: Bryan O'Sullivan <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ipath/ipath_file_ops.c |    9 +++++----
 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 9ca582b..1272aaf 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,
         */
        if (!cpus_empty(current->cpus_allowed) &&
            !cpus_full(current->cpus_allowed)) {
-               int ncpus = num_online_cpus(), curcpu = -1;
+               int ncpus = num_online_cpus(), curcpu = -1, nset = 0;
                for (i = 0; i < ncpus; i++)
                        if (cpu_isset(i, current->cpus_allowed)) {
                                ipath_cdbg(PROC, "%s[%u] affinity set for "
-                                          "cpu %d\n", current->comm,
-                                          current->pid, i);
+                                          "cpu %d/%d\n", current->comm,
+                                          current->pid, i, ncpus);
                                curcpu = i;
+                               nset++;
                        }
-               if (curcpu != -1) {
+               if (curcpu != -1 && nset != ncpus) {
                        if (npresent) {
                                prefunit = curcpu / (ncpus / npresent);
                                ipath_cdbg(PROC,"%s[%u] %d chips, %d cpus, "
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to