Commit 3de5e46e authored by Frederic Weisbecker's avatar Frederic Weisbecker Committed by Ingo Molnar
Browse files

genirq: Remove cpumask availability check on kthread affinity setting



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 a historical
leftover. Get rid also of the comments above it that are obsolete and
useless.

Suggested-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20251121143500.42111-4-frederic@kernel.org
parent 801afdfb
Loading
Loading
Loading
Loading
+4 −13
Original line number Diff line number Diff line
@@ -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,20 +1017,12 @@ 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;

		m = irq_data_get_effective_affinity_mask(&desc->irq_data);
		cpumask_copy(mask, m);
			valid = true;
		}
	}

	if (valid)
	set_cpus_allowed_ptr(current, mask);
	free_cpumask_var(mask);
}