.. | .. |
---|
1039 | 1039 | struct hfi1_affinity_node *entry; |
---|
1040 | 1040 | cpumask_var_t diff, hw_thread_mask, available_mask, intrs_mask; |
---|
1041 | 1041 | const struct cpumask *node_mask, |
---|
1042 | | - *proc_mask = ¤t->cpus_allowed; |
---|
| 1042 | + *proc_mask = current->cpus_ptr; |
---|
1043 | 1043 | struct hfi1_affinity_node_list *affinity = &node_affinity; |
---|
1044 | 1044 | struct cpu_mask_set *set = &affinity->proc; |
---|
1045 | 1045 | |
---|
.. | .. |
---|
1047 | 1047 | * check whether process/context affinity has already |
---|
1048 | 1048 | * been set |
---|
1049 | 1049 | */ |
---|
1050 | | - if (cpumask_weight(proc_mask) == 1) { |
---|
| 1050 | + if (current->nr_cpus_allowed == 1) { |
---|
1051 | 1051 | hfi1_cdbg(PROC, "PID %u %s affinity set to CPU %*pbl", |
---|
1052 | 1052 | current->pid, current->comm, |
---|
1053 | 1053 | cpumask_pr_args(proc_mask)); |
---|
.. | .. |
---|
1058 | 1058 | cpu = cpumask_first(proc_mask); |
---|
1059 | 1059 | cpumask_set_cpu(cpu, &set->used); |
---|
1060 | 1060 | goto done; |
---|
1061 | | - } else if (cpumask_weight(proc_mask) < cpumask_weight(&set->mask)) { |
---|
| 1061 | + } else if (current->nr_cpus_allowed < cpumask_weight(&set->mask)) { |
---|
1062 | 1062 | hfi1_cdbg(PROC, "PID %u %s affinity set to CPU set(s) %*pbl", |
---|
1063 | 1063 | current->pid, current->comm, |
---|
1064 | 1064 | cpumask_pr_args(proc_mask)); |
---|