Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256660
b: refs/heads/master
c: 0cd85e6
h: refs/heads/master
v: v3
  • Loading branch information
Motohiro KOSAKI authored and Roland Dreier committed Jul 18, 2011
1 parent d28198c commit e950328
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 52a09a040dc258ca9eb4fa6530e52ccdbc72e353
refs/heads/master: 0cd85e6738976b753fb156d833c94083418b3ae4
11 changes: 6 additions & 5 deletions trunk/drivers/infiniband/hw/qib/qib_file_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,7 @@ static int qib_assign_ctxt(struct file *fp, const struct qib_user_info *uinfo)
struct qib_filedata *fd = fp->private_data;
const struct qib_ctxtdata *rcd = fd->rcd;
const struct qib_devdata *dd = rcd->dd;
unsigned int weight;

if (dd->flags & QIB_HAS_SEND_DMA) {
fd->pq = qib_user_sdma_queue_create(&dd->pcidev->dev,
Expand All @@ -1545,22 +1546,22 @@ static int qib_assign_ctxt(struct file *fp, const struct qib_user_info *uinfo)
* it just means that sooner or later we don't recommend
* a cpu, and let the scheduler do it's best.
*/
if (!ret && cpus_weight(current->cpus_allowed) >=
qib_cpulist_count) {
weight = cpumask_weight(tsk_cpus_allowed(current));
if (!ret && weight >= qib_cpulist_count) {
int cpu;
cpu = find_first_zero_bit(qib_cpulist,
qib_cpulist_count);
if (cpu != qib_cpulist_count) {
__set_bit(cpu, qib_cpulist);
fd->rec_cpu_num = cpu;
}
} else if (cpus_weight(current->cpus_allowed) == 1 &&
test_bit(first_cpu(current->cpus_allowed),
} else if (weight == 1 &&
test_bit(cpumask_first(tsk_cpus_allowed(current)),
qib_cpulist))
qib_devinfo(dd->pcidev, "%s PID %u affinity "
"set to cpu %d; already allocated\n",
current->comm, current->pid,
first_cpu(current->cpus_allowed));
cpumask_first(tsk_cpus_allowed(current)));
}

mutex_unlock(&qib_mutex);
Expand Down

0 comments on commit e950328

Please sign in to comment.