mirror of
https://github.com/torvalds/linux
synced 2024-09-24 13:31:12 +00:00
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 <dave.olson@qlogic.com> Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
parent
662af5813b
commit
f0810daf74
|
@ -1592,15 +1592,16 @@ static int find_best_unit(struct file *fp,
|
||||||
*/
|
*/
|
||||||
if (!cpus_empty(current->cpus_allowed) &&
|
if (!cpus_empty(current->cpus_allowed) &&
|
||||||
!cpus_full(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++)
|
for (i = 0; i < ncpus; i++)
|
||||||
if (cpu_isset(i, current->cpus_allowed)) {
|
if (cpu_isset(i, current->cpus_allowed)) {
|
||||||
ipath_cdbg(PROC, "%s[%u] affinity set for "
|
ipath_cdbg(PROC, "%s[%u] affinity set for "
|
||||||
"cpu %d\n", current->comm,
|
"cpu %d/%d\n", current->comm,
|
||||||
current->pid, i);
|
current->pid, i, ncpus);
|
||||||
curcpu = i;
|
curcpu = i;
|
||||||
|
nset++;
|
||||||
}
|
}
|
||||||
if (curcpu != -1) {
|
if (curcpu != -1 && nset != ncpus) {
|
||||||
if (npresent) {
|
if (npresent) {
|
||||||
prefunit = curcpu / (ncpus / npresent);
|
prefunit = curcpu / (ncpus / npresent);
|
||||||
ipath_cdbg(PROC,"%s[%u] %d chips, %d cpus, "
|
ipath_cdbg(PROC,"%s[%u] %d chips, %d cpus, "
|
||||||
|
|
Loading…
Reference in a new issue