Re: [PATCH] 2.6.17-rt1 : fix x86_64 oops

From: Ingo Molnar
Date: Tue Jul 04 2006 - 02:53:31 EST



* Ingo Molnar <mingo@xxxxxxx> wrote:

> > Ingo, do you have a suspect ?
>
> I suspect it's the patch below. That patch (from John) relaxes the
> affinities of IRQ threads: if there are /proc/irq/*/smp_affinity
> entries that have multiple bits set an IRQ thread is allowed to jump
> from one CPU to another while it is executing a IRQ-handler. It
> _should_ be fine but i'd not be surprised if that caused breakage ...

the patch below is against 2.6.17-rt5, does this solve the crashes?

Ingo

Index: linux-rt.q/kernel/irq/manage.c
===================================================================
--- linux-rt.q.orig/kernel/irq/manage.c
+++ linux-rt.q/kernel/irq/manage.c
@@ -645,17 +645,24 @@ extern asmlinkage void __do_softirq(void

static int curr_irq_prio = 49;

-static int do_irqd(void * __desc)
+static void follow_irq_affinity(struct irq_desc *desc)
{
- struct sched_param param = { 0, };
- struct irq_desc *desc = __desc;
#ifdef CONFIG_SMP
- int irq = desc - irq_desc;
cpumask_t mask;

- mask = cpumask_of_cpu(any_online_cpu(irq_desc[irq].affinity));
+ if (cpus_equal(current->cpus_allowed, desc->affinity))
+ return;
+ mask = cpumask_of_cpu(any_online_cpu(desc->affinity));
set_cpus_allowed(current, mask);
#endif
+}
+
+static int do_irqd(void * __desc)
+{
+ struct sched_param param = { 0, };
+ struct irq_desc *desc = __desc;
+
+ follow_irq_affinity(desc);
current->flags |= PF_NOFREEZE | PF_HARDIRQ;

/*
@@ -674,13 +681,7 @@ static int do_irqd(void * __desc)
local_irq_disable();
__do_softirq();
local_irq_enable();
-#ifdef CONFIG_SMP
- /*
- * Did IRQ affinities change?
- */
- if (!cpus_equal(current->cpus_allowed, irq_desc[irq].affinity))
- set_cpus_allowed(current, irq_desc[irq].affinity);
-#endif
+ follow_irq_affinity(desc);
schedule();
}
__set_current_state(TASK_RUNNING);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/