mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] genirq: Fix IRQ threads VS cpuset
@ 2025-11-18 14:30 Frederic Weisbecker
  2025-11-18 14:30 ` [PATCH 1/2] genirq: Fix IRQ threads affinity VS cpuset isolated partitions Frederic Weisbecker
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Frederic Weisbecker @ 2025-11-18 14:30 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Frederic Weisbecker, Marco Crivellari, Waiman Long, cgroups

Hi,

See here for previous patch:

	https://lore.kernel.org/lkml/20251105131726.46364-1-frederic@kernel.org/

Changes since v1:

* Remove handling of cpumask availability

Frederic Weisbecker (2):
  genirq: Fix IRQ threads affinity VS cpuset isolated partitions
  genirq: Remove cpumask availability check on kthread affinity setting

 kernel/irq/manage.c | 43 +++++++++++++++++--------------------------
 1 file changed, 17 insertions(+), 26 deletions(-)

-- 
2.51.0


^ permalink raw reply	[flat|nested] 19+ messages in thread
* [PATCH 3/3 v3] genirq: Remove cpumask availability check on kthread affinity setting
@ 2025-11-21 14:35 Frederic Weisbecker
  2025-11-21 20:01 ` [tip: irq/core] " tip-bot2 for Frederic Weisbecker
  2025-11-22  8:30 ` tip-bot2 for Frederic Weisbecker
  0 siblings, 2 replies; 19+ messages in thread
From: Frederic Weisbecker @ 2025-11-21 14:35 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, Frederic Weisbecker, Marek Szyprowski, Marco Crivellari,
	Waiman Long, cgroups

Failing to allocate the affinity mask of an interrupt descriptor fails the
whole descriptor initialization. It is then guaranteed that the cpumask is
always available whenever the related interrupt objects are alive, such as
the kthread handler.

Therefore remove the superfluous check since it is merely just a historical
leftover. Get rid also of the comments above it that are either obsolete or
useless.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://patch.msgid.link/20251118143052.68778-3-frederic@kernel.org
---
 kernel/irq/manage.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 98b9b8b4de27..76c7b58f54c8 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1001,7 +1001,6 @@ static irqreturn_t irq_forced_secondary_handler(int irq, void *dev_id)
 static void irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action)
 {
 	cpumask_var_t mask;
-	bool valid = false;
 
 	if (!test_and_clear_bit(IRQTF_AFFINITY, &action->thread_flags))
 		return;
@@ -1018,21 +1017,13 @@ static void irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *a
 	}
 
 	scoped_guard(raw_spinlock_irq, &desc->lock) {
-		/*
-		 * This code is triggered unconditionally. Check the affinity
-		 * mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out.
-		 */
-		if (cpumask_available(desc->irq_common_data.affinity)) {
-			const struct cpumask *m;
+		const struct cpumask *m;
 
-			m = irq_data_get_effective_affinity_mask(&desc->irq_data);
-			cpumask_copy(mask, m);
-			valid = true;
-		}
+		m = irq_data_get_effective_affinity_mask(&desc->irq_data);
+		cpumask_copy(mask, m);
 	}
 
-	if (valid)
-		set_cpus_allowed_ptr(current, mask);
+	set_cpus_allowed_ptr(current, mask);
 	free_cpumask_var(mask);
 }
 #else
-- 
2.51.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2025-11-22  8:30 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-18 14:30 [PATCH 0/2] genirq: Fix IRQ threads VS cpuset Frederic Weisbecker
2025-11-18 14:30 ` [PATCH 1/2] genirq: Fix IRQ threads affinity VS cpuset isolated partitions Frederic Weisbecker
2025-11-18 15:26   ` [tip: irq/core] genirq: Fix interrupt threads affinity vs. " tip-bot2 for Frederic Weisbecker
2025-11-18 16:27   ` [PATCH 1/2] genirq: Fix IRQ threads affinity VS " Waiman Long
2025-11-18 17:23     ` Thomas Gleixner
2025-11-18 17:29       ` Waiman Long
     [not found]   ` <CGME20251120115132eucas1p160658ba63831911aadd0b0c2f70b7e28@eucas1p1.samsung.com>
2025-11-20 11:51     ` Marek Szyprowski
2025-11-20 13:20       ` Frederic Weisbecker
2025-11-20 15:00         ` Thomas Gleixner
2025-11-20 15:50           ` Frederic Weisbecker
2025-11-20 19:09             ` Thomas Gleixner
2025-11-20 16:34           ` Marek Szyprowski
2025-11-20 13:45       ` Thomas Gleixner
2025-11-18 14:30 ` [PATCH 2/2] genirq: Remove cpumask availability check on kthread affinity setting Frederic Weisbecker
2025-11-18 15:26   ` [tip: irq/core] " tip-bot2 for Frederic Weisbecker
2025-11-18 15:14 ` [PATCH 0/2] genirq: Fix IRQ threads VS cpuset Thomas Gleixner
2025-11-18 17:44   ` Frederic Weisbecker
2025-11-21 14:35 [PATCH 3/3 v3] genirq: Remove cpumask availability check on kthread affinity setting Frederic Weisbecker
2025-11-21 20:01 ` [tip: irq/core] " tip-bot2 for Frederic Weisbecker
2025-11-22  8:30 ` tip-bot2 for Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®