hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/drivers/infiniband/hw/hfi1/affinity.c
....@@ -1039,7 +1039,7 @@
10391039 struct hfi1_affinity_node *entry;
10401040 cpumask_var_t diff, hw_thread_mask, available_mask, intrs_mask;
10411041 const struct cpumask *node_mask,
1042
- *proc_mask = &current->cpus_allowed;
1042
+ *proc_mask = current->cpus_ptr;
10431043 struct hfi1_affinity_node_list *affinity = &node_affinity;
10441044 struct cpu_mask_set *set = &affinity->proc;
10451045
....@@ -1047,7 +1047,7 @@
10471047 * check whether process/context affinity has already
10481048 * been set
10491049 */
1050
- if (cpumask_weight(proc_mask) == 1) {
1050
+ if (current->nr_cpus_allowed == 1) {
10511051 hfi1_cdbg(PROC, "PID %u %s affinity set to CPU %*pbl",
10521052 current->pid, current->comm,
10531053 cpumask_pr_args(proc_mask));
....@@ -1058,7 +1058,7 @@
10581058 cpu = cpumask_first(proc_mask);
10591059 cpumask_set_cpu(cpu, &set->used);
10601060 goto done;
1061
- } else if (cpumask_weight(proc_mask) < cpumask_weight(&set->mask)) {
1061
+ } else if (current->nr_cpus_allowed < cpumask_weight(&set->mask)) {
10621062 hfi1_cdbg(PROC, "PID %u %s affinity set to CPU set(s) %*pbl",
10631063 current->pid, current->comm,
10641064 cpumask_pr_args(proc_mask));