[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181023014044.15888-1-longli@linuxonhyperv.com>
Date: Tue, 23 Oct 2018 01:40:44 +0000
From: Long Li <longli@...uxonhyperv.com>
To: Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org
Cc: Long Li <longli@...rosoft.com>
Subject: [PATCH] Choose CPU based on allocated IRQs
From: Long Li <longli@...rosoft.com>
In irq_matrix, "available" is set when IRQs are allocated earlier in the IRQ
assigning process.
Later, when IRQs are activated those values are not good indicators of what
CPU to choose to assign to this IRQ.
Change to choose CPU for an IRQ based on how many IRQs are already allocated
on this CPU.
Signed-off-by: Long Li <longli@...rosoft.com>
---
kernel/irq/matrix.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/irq/matrix.c b/kernel/irq/matrix.c
index 6e6d467f3dec..a51689e3e7c0 100644
--- a/kernel/irq/matrix.c
+++ b/kernel/irq/matrix.c
@@ -128,7 +128,7 @@ static unsigned int matrix_alloc_area(struct irq_matrix *m, struct cpumap *cm,
static unsigned int matrix_find_best_cpu(struct irq_matrix *m,
const struct cpumask *msk)
{
- unsigned int cpu, best_cpu, maxavl = 0;
+ unsigned int cpu, best_cpu, min_allocated = UINT_MAX;
struct cpumap *cm;
best_cpu = UINT_MAX;
@@ -136,11 +136,11 @@ static unsigned int matrix_find_best_cpu(struct irq_matrix *m,
for_each_cpu(cpu, msk) {
cm = per_cpu_ptr(m->maps, cpu);
- if (!cm->online || cm->available <= maxavl)
+ if (!cm->online || cm->allocated > min_allocated)
continue;
best_cpu = cpu;
- maxavl = cm->available;
+ min_allocated = cm->allocated;
}
return best_cpu;
}
--
2.14.1
Powered by blists - more mailing lists