|
@@ -66,6 +66,13 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd)
|
|
struct cpumask *masks;
|
|
struct cpumask *masks;
|
|
cpumask_var_t nmsk;
|
|
cpumask_var_t nmsk;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * If there aren't any vectors left after applying the pre/post
|
|
|
|
+ * vectors don't bother with assigning affinity.
|
|
|
|
+ */
|
|
|
|
+ if (!affv)
|
|
|
|
+ return NULL;
|
|
|
|
+
|
|
if (!zalloc_cpumask_var(&nmsk, GFP_KERNEL))
|
|
if (!zalloc_cpumask_var(&nmsk, GFP_KERNEL))
|
|
return NULL;
|
|
return NULL;
|
|
|
|
|
|
@@ -140,15 +147,19 @@ out:
|
|
|
|
|
|
/**
|
|
/**
|
|
* irq_calc_affinity_vectors - Calculate the optimal number of vectors
|
|
* irq_calc_affinity_vectors - Calculate the optimal number of vectors
|
|
|
|
+ * @minvec: The minimum number of vectors available
|
|
* @maxvec: The maximum number of vectors available
|
|
* @maxvec: The maximum number of vectors available
|
|
* @affd: Description of the affinity requirements
|
|
* @affd: Description of the affinity requirements
|
|
*/
|
|
*/
|
|
-int irq_calc_affinity_vectors(int maxvec, const struct irq_affinity *affd)
|
|
|
|
|
|
+int irq_calc_affinity_vectors(int minvec, int maxvec, const struct irq_affinity *affd)
|
|
{
|
|
{
|
|
int resv = affd->pre_vectors + affd->post_vectors;
|
|
int resv = affd->pre_vectors + affd->post_vectors;
|
|
int vecs = maxvec - resv;
|
|
int vecs = maxvec - resv;
|
|
int cpus;
|
|
int cpus;
|
|
|
|
|
|
|
|
+ if (resv > minvec)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
/* Stabilize the cpumasks */
|
|
/* Stabilize the cpumasks */
|
|
get_online_cpus();
|
|
get_online_cpus();
|
|
cpus = cpumask_weight(cpu_online_mask);
|
|
cpus = cpumask_weight(cpu_online_mask);
|