Skip to content

Commit

Permalink
Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/tip/tip

Pull irq fix from Thomas Gleixner:
 "A fix for the irq affinity spread algorithm so it handles non linear
  node numbering nicely"

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  genirq/affinity: Fix node generation from cpumask
  • Loading branch information
Linus Torvalds committed Dec 18, 2016
2 parents 52f40e9 + c0af524 commit eb3a3c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/irq/affinity.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ static void irq_spread_init_one(struct cpumask *irqmsk, struct cpumask *nmsk,

static int get_nodes_in_cpumask(const struct cpumask *mask, nodemask_t *nodemsk)
{
int n, nodes;
int n, nodes = 0;

/* Calculate the number of nodes in the supplied affinity mask */
for (n = 0, nodes = 0; n < num_online_nodes(); n++) {
for_each_online_node(n) {
if (cpumask_intersects(mask, cpumask_of_node(n))) {
node_set(n, *nodemsk);
nodes++;
Expand Down Expand Up @@ -82,7 +82,7 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd)
nodes = get_nodes_in_cpumask(cpu_online_mask, &nodemsk);

/*
* If the number of nodes in the mask is less than or equal the
* If the number of nodes in the mask is greater than or equal the
* number of vectors we just spread the vectors across the nodes.
*/
if (affv <= nodes) {
Expand Down

0 comments on commit eb3a3c0

Please sign in to comment.