Skip to content

Commit 3de5e46

Browse files
Frederic Weisbeckeringomolnar
authored andcommitted
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: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://patch.msgid.link/20251121143500.42111-4-frederic@kernel.org
1 parent 801afdf commit 3de5e46

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

kernel/irq/manage.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,6 @@ static irqreturn_t irq_forced_secondary_handler(int irq, void *dev_id)
10011001
static void irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action)
10021002
{
10031003
cpumask_var_t mask;
1004-
bool valid = false;
10051004

10061005
if (!test_and_clear_bit(IRQTF_AFFINITY, &action->thread_flags))
10071006
return;
@@ -1018,21 +1017,13 @@ static void irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *a
10181017
}
10191018

10201019
scoped_guard(raw_spinlock_irq, &desc->lock) {
1021-
/*
1022-
* This code is triggered unconditionally. Check the affinity
1023-
* mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out.
1024-
*/
1025-
if (cpumask_available(desc->irq_common_data.affinity)) {
1026-
const struct cpumask *m;
1020+
const struct cpumask *m;
10271021

1028-
m = irq_data_get_effective_affinity_mask(&desc->irq_data);
1029-
cpumask_copy(mask, m);
1030-
valid = true;
1031-
}
1022+
m = irq_data_get_effective_affinity_mask(&desc->irq_data);
1023+
cpumask_copy(mask, m);
10321024
}
10331025

1034-
if (valid)
1035-
set_cpus_allowed_ptr(current, mask);
1026+
set_cpus_allowed_ptr(current, mask);
10361027
free_cpumask_var(mask);
10371028
}
10381029
#else

0 commit comments

Comments
 (0)