Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1643948 > unrolled thread

[PATCH] irqchip/gicv3-its: skip irq affinity setting when target cpu is the same as current setting

Started byMajun <majun258@huawei.com>
First post2017-05-18 10:30 +0200
Last post2017-05-18 10:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] irqchip/gicv3-its: skip irq affinity setting when target cpu is the same as current setting Majun <majun258@huawei.com> - 2017-05-18 10:30 +0200

#1643948 — [PATCH] irqchip/gicv3-its: skip irq affinity setting when target cpu is the same as current setting

FromMajun <majun258@huawei.com>
Date2017-05-18 10:30 +0200
Subject[PATCH] irqchip/gicv3-its: skip irq affinity setting when target cpu is the same as current setting
Message-ID<tIoYN-7HX-3@gated-at.bofh.it>
From: MaJun <majun258@huawei.com>

Just skip the irq affinity setting when the target cpu is the same as
current setting.
This is a small optimization for irq affinity setting logic.

Signed-off-by: MaJun <majun258@huawei.com>
---
 drivers/irqchip/irq-gic-v3-its.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 45ea1933..b335280 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -644,9 +644,12 @@ static int its_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
 	if (cpu >= nr_cpu_ids)
 		return -EINVAL;
 
-	target_col = &its_dev->its->collections[cpu];
-	its_send_movi(its_dev, target_col, id);
-	its_dev->event_map.col_map[id] = cpu;
+	/* don't set the affinity when the target cpu is same as current one */
+	if (cpu != its_dev->event_map.col_map[id]) {
+		target_col = &its_dev->its->collections[cpu];
+		its_send_movi(its_dev, target_col, id);
+		its_dev->event_map.col_map[id] = cpu;
+	}
 
 	return IRQ_SET_MASK_OK_DONE;
 }
-- 
1.7.12.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web