Lines Matching +full:out +full:- +full:masks

1 // SPDX-License-Identifier: GPL-2.0
4 * Copyright (C) 2016-2017 Christoph Hellwig.
14 affd->nr_sets = 1; in default_calc_sets()
15 affd->set_size[0] = affvecs; in default_calc_sets()
19 * irq_create_affinity_masks - Create affinity masks for multiqueue spreading
29 struct irq_affinity_desc *masks = NULL; in irq_create_affinity_masks() local
37 if (nvecs > affd->pre_vectors + affd->post_vectors) in irq_create_affinity_masks()
38 affvecs = nvecs - affd->pre_vectors - affd->post_vectors; in irq_create_affinity_masks()
46 if (!affd->calc_sets) in irq_create_affinity_masks()
47 affd->calc_sets = default_calc_sets; in irq_create_affinity_masks()
50 affd->calc_sets(affd, affvecs); in irq_create_affinity_masks()
52 if (WARN_ON_ONCE(affd->nr_sets > IRQ_AFFINITY_MAX_SETS)) in irq_create_affinity_masks()
59 masks = kcalloc(nvecs, sizeof(*masks), GFP_KERNEL); in irq_create_affinity_masks()
60 if (!masks) in irq_create_affinity_masks()
63 /* Fill out vectors at the beginning that don't need affinity */ in irq_create_affinity_masks()
64 for (curvec = 0; curvec < affd->pre_vectors; curvec++) in irq_create_affinity_masks()
65 cpumask_copy(&masks[curvec].mask, irq_default_affinity); in irq_create_affinity_masks()
68 * Spread on present CPUs starting from affd->pre_vectors. If we in irq_create_affinity_masks()
71 for (i = 0, usedvecs = 0; i < affd->nr_sets; i++) { in irq_create_affinity_masks()
72 unsigned int this_vecs = affd->set_size[i]; in irq_create_affinity_masks()
77 kfree(masks); in irq_create_affinity_masks()
82 cpumask_copy(&masks[curvec + j].mask, &result[j]); in irq_create_affinity_masks()
89 /* Fill out vectors at the end that don't need affinity */ in irq_create_affinity_masks()
91 curvec = affd->pre_vectors + affvecs; in irq_create_affinity_masks()
93 curvec = affd->pre_vectors + usedvecs; in irq_create_affinity_masks()
95 cpumask_copy(&masks[curvec].mask, irq_default_affinity); in irq_create_affinity_masks()
98 for (i = affd->pre_vectors; i < nvecs - affd->post_vectors; i++) in irq_create_affinity_masks()
99 masks[i].is_managed = 1; in irq_create_affinity_masks()
101 return masks; in irq_create_affinity_masks()
105 * irq_calc_affinity_vectors - Calculate the optimal number of vectors
113 unsigned int resv = affd->pre_vectors + affd->post_vectors; in irq_calc_affinity_vectors()
119 if (affd->calc_sets) { in irq_calc_affinity_vectors()
120 set_vecs = maxvec - resv; in irq_calc_affinity_vectors()
127 return resv + min(set_vecs, maxvec - resv); in irq_calc_affinity_vectors()